Exposure point burying method, exposure point burying device and computer storage medium
By initializing configuration examples and exposure controllers to manage exposure control registrants, and automatically detecting and reporting exposure buried points, the problems of large amount of buried points without buried points and low development efficiency in manual buried points in the existing technology are solved, and development efficiency is improved.
Patent Information
- Application Number
- CN202510460063.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-08-26
AI Technical Summary
The page control exposure buried point method in the prior art has the problem of large amount of buried point data and low efficiency in manual buried point development.
By initializing configuration instances, using exposure controllers and timers to manage exposure control registrants, automating detection and reporting exposure buried points, simplifying development logic processing.
It realizes automatic management of exposure detection and point reporting, improves development efficiency and reduces developers' logical processing of exposure point reporting.
Smart Images

Figure CN120540928A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of page embedding technology, and in particular to an exposure embedding method, an exposure embedding device and a computer storage medium. Background Art
[0002] A page control refers to a visible area on a mobile page, such as buttons, images, and text. Exposure refers to the state in which a control is displayed on the screen and is visible to the user. Exposure tracking reports the exposure event and related business data to the backend server. Developers use this information to assess whether the page content is sufficiently appealing to users, and can continuously improve the content displayed to provide better services for users.
[0003] There are two common methods for tracking page control exposure in related technologies: non-tracking and manual tracking. However, non-tracking reports a massive amount of data, making the backend filtering process complex and difficult to clearly organize relevant business data. Manual tracking requires page developers to implement exposure detection logic for each control, resulting in low development efficiency and impacting business iteration efficiency. Summary of the Invention
[0004] In order to solve the above technical problems, the present application proposes an exposure point burying method, an exposure point burying device and a computer storage medium.
[0005] To solve the above technical problems, the present application proposes an exposure and burying method, which includes:
[0006] In response to application startup, initializing the configuration class instance;
[0007] Initializing the exposure controller using the configuration class instance;
[0008] Initializing a timer by the exposure controller according to the effective exposure duration of the configuration class instance;
[0009] triggering the check control exposure logic in the exposure control register managed in the exposure controller according to the timer polling timing;
[0010] When the exposure logic of the inspection control is satisfied, the buried points are exposed through the reporting buried point logic of the exposure control register.
[0011] Wherein, the exposure controller is a singleton.
[0012] The step of triggering the exposure control check logic in the exposure control register managed by the exposure controller according to the timer polling timing includes:
[0013] triggering the exposure control register managed in the exposure controller according to the timer polling timing;
[0014] Detecting the exposure control data class registered in the exposure control register to determine whether the page control meets the exposure conditions;
[0015] If so, confirm that the check control exposure logic is satisfied.
[0016] Before determining whether the page control meets the exposure condition, the exposure tracking method further includes:
[0017] confirming the exposure condition based on a valid threshold value of the configuration class;
[0018] The effective thresholds include: effective exposure area thresholds, effective transparency thresholds, and / or effective control width and height thresholds.
[0019] The step of triggering the exposure control check logic in the exposure control register managed by the exposure controller according to the timer polling timing includes:
[0020] In response to the page control satisfying the exposure condition, detecting whether the page control is actually exposed through an event responder chain;
[0021] If so, confirm that the page control is in an exposed state.
[0022] The exposure and burying method further includes:
[0023] In response to the page control not meeting the exposure condition or not being actually exposed, the state value stored in the exposure control data class is set to a not uploaded value.
[0024] The detecting of the exposure control data class registered in the exposure control register includes:
[0025] Determine whether the controller corresponding to the exposure control register is in a visible state;
[0026] If so, the exposure control data class registered in the exposure register is detected.
[0027] When the check control exposure logic is satisfied, exposing the tracking point through the reporting tracking point logic of the exposure control register includes:
[0028] When the exposure logic of the check control is satisfied, obtaining the state value stored in the exposure control data class;
[0029] In response to the status value being a not uploaded value, the buried point data stored in the exposure control data class is reported and the status value stored in the exposure control data class is set to an uploaded value.
[0030] In order to solve the above technical problems, the present application also proposes an exposure burying device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the exposure burying method as described above.
[0031] In order to solve the above technical problems, the present application also proposes a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the above exposure burying method.
[0032] Compared with the prior art, the beneficial effects of this application are as follows: the exposure tracking device initializes the configuration class instance in response to application startup; uses the configuration class instance to initialize the exposure controller; initializes the timer according to the effective exposure duration of the configuration class instance through the exposure controller; triggers the check control exposure logic in the exposure control register managed by the exposure controller according to the timer polling schedule; and when the check control exposure logic is met, the exposure tracking is performed through the reporting tracking logic of the exposure control register. The above-mentioned exposure tracking method simplifies business development, reduces the developer's logical processing of exposure tracking, and automatically manages exposure detection and reports tracking through the exposure controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0034] in:
[0035] Figure 1 This is a flow chart of an embodiment of the exposure and burying method provided by the present application;
[0036] Figure 2 This is a schematic diagram of the overall process of the exposure and embedding method provided by this application;
[0037] Figure 3 This is a structural diagram of an embodiment of an exposure and embedding device provided by the present application;
[0038] Figure 4 It is a structural schematic diagram of another embodiment of the exposure embedding device provided by the present application;
[0039] Figure 5 It is a structural diagram of an embodiment of a computer storage medium provided by this application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0041] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and in the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus comprising 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 apparatus.
[0042] In order to solve the problems of the prior art, the present application provides an exposure tracking method for page controls, which can be applied to various mobile operating systems, such as iOS (iPhone Operating System) system.
[0043] Please refer to the following for details: Figure 1 and Figure 2 , Figure 1 This is a flow chart of an embodiment of the exposure and burying method provided by this application. Figure 2 It is a schematic diagram of the overall process of the exposure point embedding method provided in this application.
[0044] The exposure burying method of the present application is applied to an exposure burying device, wherein the exposure burying device of the present application can be a server, a terminal device, or a system in which a server and a terminal device cooperate with each other. Accordingly, the various parts included in the exposure burying device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.
[0045] Furthermore, the server described above may be either hardware or software. When the server is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it may be implemented as multiple software programs or software modules, such as software or software modules for providing a distributed server, or as a single software program or software module, without further limitation.
[0046] like Figure 2 As shown, before executing the exposure tracking method of the present application, the exposure tracking device needs to initialize the exposure tracking module first. The following first introduces the specific content of the exposure tracking module:
[0047] The exposure tracking module configuration class (ViewMonitorConfig) is used to configure the effective exposure duration, effective exposure area threshold, effective transparency threshold, effective control width and height threshold, etc.
[0048] The exposure control data class (ViewMonitor) is used to save the controls to be exposed, tracking information, and exposure status.
[0049] The exposure control register (ViewMonitorManger) has a ViewMonitorManger instance for each ViewController instance in the iOS system. All controls on that controller that need to report exposure tracking points must register the control instance and tracking point information saved in the ViewMonitor initialization method with the ViewMonitorManger instance held by the current controller. Each created ViewMonitorManger instance is added to the monitorMgrs array in the ViewMonitorService singleton. The register also has the ability to check exposure controls and report corresponding tracking point information based on the configuration information of the configuration class.
[0050] The exposure controller (ViewMonitorService) is a singleton instance that manages all created exposure control registries (ViewMonitorManger). During initialization, it creates a timer based on the valid exposure duration data in the configuration class. This timer periodically polls the managed ViewMonitorManger instance and triggers the ViewMonitorManger instance's methods for checking exposure controls and reporting tracking points.
[0051] The singleton pattern is a commonly used software design pattern. Its core structure consists of a single special class called a singleton. The singleton pattern ensures that a class in a system has only one instance and that this instance is easily accessible, thus facilitating instance control and conserving system resources.
[0052] UIViewController: short for controller, a core class of the UIKit (User Interface Kit) framework in the iOS system, used to manage the life cycle of one or more views, respond to user input and operations, and is responsible for page jumps and navigation; each UIViewController has a view property, which is the controller's root view. The controller's view is the container of all the subviews it manages.
[0053] The application process of the above exposure tracking module at the business layer is as follows:
[0054] The exposure tracking device creates a basic controller class (BaseViewController), adds the ViewMonitorManger type property monitor, and implements the instantiation of the monitor in a lazy loading manner; adds the method: (void)addMonitorWithView:(UIView)view trackData:(id)data; Method implementation: Encapsulate the registered controls and the corresponding tracking information into a ViewMonitor instance by initializing the ViewMonitor class, and add the instance to the monitorsArray array of the corresponding monitor instance.
[0055] Then, the business interface controller class needs to inherit the base controller class (BaseViewController). If the controls on the controller's root view need to report exposure tracking points, just call the (void)addMonitorWithView:(UIView)view trackData:(id)data method in the control class.
[0056] Based on the above introduction to the exposure tracking module, the exposure tracking method provided by this application is as follows Figure 1 As shown, the specific steps are as follows:
[0057] Step S11: In response to application startup, the configuration class instance is initialized.
[0058] In an embodiment of the present application, when the mobile APP (Application) is started, the exposure tracking device initializes the configuration class (ViewMonitorConfig) and uses the configuration class instance to initialize the exposure controller in the exposure tracking module.
[0059] Step S12: Initialize the exposure controller using the configuration class instance.
[0060] In an embodiment of the present application, when the exposure burying device initializes the exposure controller, the configuration class instance initialized in step S11 is set to the exposure controller singleton.
[0061] Step S13: Initializing a timer according to the effective exposure duration of the configuration class instance via the exposure controller.
[0062] In an embodiment of the present application, the exposure tracking device initializes a timer for polling according to the effective exposure duration (for example, 200ms) set in the configuration class instance, and periodically triggers the method of checking control exposure and reporting corresponding tracking points in the exposure control register managed in the exposure controller.
[0063] Step S14: triggering the check control exposure logic in the exposure control register managed in the exposure controller according to the timer polling timing.
[0064] In an embodiment of the present application, the exposure burying device periodically triggers the check control exposure logic in the exposure control register managed in the exposure controller according to the effective exposure duration initialized in step S13, and detects the exposure control data class registered in the exposure control register to detect whether a situation requiring exposure burying occurs.
[0065] Specifically, the exposure logic for the check control in the exposure control register is pre-written into the exposure control register and can be triggered by the exposure controller according to a timer. Therefore, the exposure logic for the check control to be implemented in this application is implemented within the exposure control register and does not require the developer of the control business to handle it.
[0066] This application's control exposure check logic primarily implements the control exposure status determination logic through the iOS event responder chain. The event responder chain is the mechanism in iOS for handling user events (such as touch, gesture, and keyboard input). It defines the path that events follow through the view hierarchy until an object capable of handling the event is found. It is a core concept of the event dispatch system in the UIKit framework.
[0067] Specifically, the judgment logic of the check control exposure logic provided by this application is as follows:
[0068] The exposure tracking device determines whether the controller corresponding to the exposure control register is in a visible state. If it is in a visible state, the subsequent logic execution continues; otherwise, the subsequent logic execution is terminated to avoid unnecessary performance overhead.
[0069] When the controller is in the visible state, the exposure control data class (ViewMonitor) registered in the exposure control register is checked one by one, and the following logic is used to determine whether the control meets the exposure conditions:
[0070] The exposure tracking device detects whether the exposure conditions of the control are met: determine whether the width and height of the control displayed within the visible range of the screen reach the valid threshold, determine whether the transparency of the control reaches the valid threshold, and determine whether the control is not hidden. If all thresholds are reached, the detection continues, that is, the subsequent judgment logic is entered; otherwise, the valid exposure conditions are not met, the detection is terminated, and the status of ViewMonitor is set to NO. The above-mentioned threshold-reaching situations are: the width and height displayed within the visible range of the screen reach the valid threshold, the transparency of the control reaches the valid threshold, and the control is not hidden.
[0071] It should be noted that the above thresholds are all defined by the exposure tracking module configuration class.
[0072] The exposure tracking device detects whether the control is actually displayed: it uses the event responder chain to determine whether the control is interactive, that is, visible to the user. Code logic: The controller's root view, view, calls the method (nullable UIView)hitTest:(CGPoint)point withEvent:(nullable UIEvent)event; by passing in the center point of the control's visible range on the screen and the touch event parameters, this method returns a responsive UIView instance. If the returned instance is equal to the control, the control is actually exposed; otherwise, the ViewMonitor status is set to NO.
[0073] Step S15: When the exposure logic of the inspection control is satisfied, the buried points are exposed through the reporting buried point logic of the exposure control register.
[0074] In an embodiment of the present application, when the check control exposure logic of step S14 is satisfied, the exposure burying point device exposes the burying point through the reporting burying point logic of the exposure control register.
[0075] Specifically, in order to avoid repeated reporting, the exposure tracking device can also determine whether the page control has uploaded the current tracking data through the status value saved in the exposure control data class.
[0076] For example, if the status saved by ViewMonitor is YES, it means that the exposure tracking data has been uploaded and no processing is performed. If the status saved by ViewMonitor is NO, the tracking data saved by ViewMonitor is reported and the status of ViewMonitor is set to YES.
[0077] In this application, an exposure tracking device initializes a configuration class instance in response to application startup; uses the configuration class instance to initialize an exposure controller; initializes a timer through the exposure controller according to the effective exposure duration of the configuration class instance; triggers the check control exposure logic in the exposure control register managed by the exposure controller according to the timer polling schedule; and when the check control exposure logic is met, the exposure tracking is performed through the reporting tracking logic of the exposure control register. The above-mentioned exposure tracking method simplifies business development, reduces the developer's logical processing of exposure tracking, and automatically manages exposure detection and reports tracking through the exposure controller.
[0078] The exposure tracking method of this application uses the exposure controller (ViewMonitorService) to realize the automatic management of exposure detection and reporting of tracking points by the control.
[0079] The exposure tracking method of this application implements the judgment logic of the control exposure status through the iOS event responder chain mechanism, which can easily realize the exposure detection and optimization of the view.
[0080] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0081] In order to realize the above exposure and embedding method, this application also proposes an exposure and embedding device. Figure 3 , Figure 3 It is a structural schematic diagram of an embodiment of the exposure point burying device provided in this application.
[0082] The exposure tracking device 500 of this embodiment includes: an initialization module 51, a checking module 52 and a reporting module 53.
[0083] The initialization module 51 is used to initialize the configuration class instance in response to the application startup.
[0084] The initialization module 51 is used to initialize the exposure controller using the configuration class instance.
[0085] The initialization module 51 is configured to initialize a timer according to the effective exposure duration of the configuration class instance through the exposure controller.
[0086] The checking module 52 is configured to trigger the checking control exposure logic in the exposure control register managed in the exposure controller according to the timer polling timing.
[0087] The reporting module 53 is used to expose the buried points through the reporting buried point logic of the exposure control register when the exposure logic of the inspection control is met.
[0088] In order to realize the above exposure and burying method, this application also proposes another exposure and burying device, please refer to Figure 4 , Figure 4 It is a structural schematic diagram of another embodiment of the exposure burying device provided in this application.
[0089] The exposure embedding device 400 of this embodiment includes a processor 41, a memory 42, an input and output device 43 and a bus 44.
[0090] The processor 41, memory 42, and input / output device 43 are respectively connected to a bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the exposure point burying method described in the above embodiment.
[0091] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having signal processing capabilities. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor, or the processor 41 may be any conventional processor.
[0092] This application also provides a computer storage medium, please continue to refer to Figure 5 , Figure 5 It is a structural diagram of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by the processor, it is used to implement the exposure burying method of the above embodiment.
[0093] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0094] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An exposure and burying method, characterized in that: The exposure and burying method includes: In response to application startup, initializing the configuration class instance; Initializing the exposure controller using the configuration class instance; Initializing a timer by the exposure controller according to the effective exposure duration of the configuration class instance; triggering the check control exposure logic in the exposure control register managed in the exposure controller according to the timer polling timing; When the exposure logic of the inspection control is satisfied, the buried points are exposed through the reporting buried point logic of the exposure control register.
2. The exposure and embedding method according to claim 1, characterized in that: The exposure controller is a singleton.
3. The exposure and embedding method according to claim 1, wherein: The step of triggering the exposure control register managed by the exposure controller according to the timer polling timing includes: triggering the exposure control register managed in the exposure controller according to the timer polling timing; Detecting the exposure control data class registered in the exposure control register to determine whether the page control meets the exposure conditions; If so, confirm that the check control exposure logic is satisfied.
4. The exposure and embedding method according to claim 3, characterized in that: Before determining whether the page control meets the exposure condition, the exposure tracking method further includes: confirming the exposure condition based on a valid threshold value of the configuration class; The effective thresholds include: effective exposure area thresholds, effective transparency thresholds, and / or effective control width and height thresholds.
5. The exposure and embedding method according to claim 3, characterized in that: The step of triggering the exposure control register managed by the exposure controller according to the timer polling timing includes: In response to the page control satisfying the exposure condition, detecting whether the page control is actually exposed through an event responder chain; If so, confirm that the page control is in an exposed state.
6. The exposure and embedding method according to claim 5, characterized in that: The exposure and burying method further includes: In response to the page control not meeting the exposure condition or not being actually exposed, the state value stored in the exposure control data class is set to a not uploaded value.
7. The exposure and embedding method according to claim 3, wherein: The detecting the exposure control data class registered in the exposure control register includes: Determine whether the controller corresponding to the exposure control register is in a visible state; If so, the exposure control data class registered in the exposure register is detected.
8. The exposure and embedding method according to claim 1, wherein: When the check control exposure logic is satisfied, exposing the tracking point through the reporting tracking point logic of the exposure control register includes: When the exposure logic of the check control is satisfied, obtaining the state value stored in the exposure control data class; In response to the status value being a not uploaded value, the buried point data stored in the exposure control data class is reported and the status value stored in the exposure control data class is set to an uploaded value.
9. An exposure and embedding device, characterized in that: The exposure embedding device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the exposure burying method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the exposure burying method as described in any one of claims 1 to 8.