CN-121979742-A - Spring layer monitoring method and device
Abstract
One or more embodiments of the present disclosure provide a method and apparatus for monitoring an elastic layer. The method monitors the existence of a masking elastic layer in a page by taking the appearance and the unloading of the masking layer as a mark for displaying and closing the masking elastic layer, and monitors the existence of the masking elastic layer in the page by monitoring a first display event for indicating the existence of the masking layer and a first end event for indicating the unloading of the masking layer, and simultaneously monitors the existence of a preset container for bearing the elastic layer and preset change as a mark for displaying and closing the no masking elastic layer by monitoring a second display event for indicating the existence of the preset container and a second end event for indicating the occurrence of the preset change of the state of the preset container. In addition, the method starts timing when the first display event or the second display event is monitored, and stops timing when the first end event or the second end event is monitored, the obtained timing duration is used as the duration of the elastic layer, and the method also carries out anomaly monitoring based on the duration.
Inventors
- WU MINGJUN
Assignees
- 支付宝(杭州)数字服务技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260122
Claims (13)
- 1. A method of bullet layer monitoring comprising: Monitoring whether a preset display event occurs in a target page or not, wherein the preset display event comprises a first display event which indicates that a mask layer occurs in the target page and a second display event which indicates that a preset container occurs in the target page, and the preset container is used for bearing an elastic layer; monitoring whether a first ending event occurs in the target page or not under the condition that the first display event is monitored, wherein the first ending event represents unloading of the mask layer; Monitoring whether a second ending event occurs in the target page or not under the condition that the first display event is not monitored and the second display event is monitored, wherein the second ending event represents that the state of the preset container is subjected to preset change; and under the condition that the first ending event or the second ending event is monitored, generating bullet layer monitoring information, wherein the bullet layer monitoring information comprises at least one piece of preset information of the bullet layer monitored at this time.
- 2. The method as recited in claim 1, further comprising: A target monitoring rule is obtained, wherein the target monitoring rule includes a rule defining at least one of the first display event, the second display event, the first end event, and the second end event.
- 3. The method of claim 1, wherein the second end event comprises at least one of: the attribute value of the preset attribute in the preset container is a preset value for representing hiding of the corresponding elastic layer; the parent container of the preset container comprises a preset class for controlling the hiding of the corresponding elastic layer.
- 4. The method of claim 1, wherein the bullet layer monitoring information includes a duration indicating a duration of display of the bullet layer currently monitored in the target page; The method further comprises the steps of: starting a preset timer under the condition that a preset display event is monitored, and starting timing; Closing the preset timer under the condition that the first ending event or the second ending event is monitored, and stopping timing; The generation of the bullet layer monitoring information comprises the step of determining the duration according to the timing duration of the preset timer.
- 5. The method of claim 4, wherein the bullet layer monitoring information further comprises reporting a control tag; The generating bullet layer monitoring information includes: Judging whether the duration exceeds a preset threshold value; setting the reporting control tag to a first tag value for indicating prohibition of reporting the bullet layer monitoring information under the condition that the duration exceeds the preset threshold; And setting the report control tag to a second tag value which indicates that the bullet layer monitoring information is allowed to be reported under the condition that the duration does not exceed the preset threshold.
- 6. The method as recited in claim 5, further comprising: And under the condition that the reporting control label is the second label value, sending the bullet layer monitoring information to a preset analysis system.
- 7. The method of claim 1, wherein monitoring whether a preset display event occurs in a target page comprises identifying, via a CSS selector, whether at least one of the mask layer or the preset container is present in the target page; Monitoring whether a first end event occurs in the target page, including identifying, by the CSS selector, whether the mask layer is absent in the target page; monitoring whether a second ending event occurs in the target page includes identifying, by the CSS selector, whether the preset container in the target page is in a preset state.
- 8. An elastic layer monitoring device, comprising: The system comprises a first monitoring module, a second monitoring module and a third monitoring module, wherein the first monitoring module is used for monitoring whether a preset display event occurs in a target page, the preset display event comprises a first display event which indicates that a mask layer occurs in the target page and a second display event which indicates that a preset container occurs in the target page, and the preset container is used for bearing an elastic layer; The second monitoring module is used for monitoring whether a first ending event occurs in the target page or not under the condition that the first display event is monitored, and monitoring whether a second ending event occurs in the target page or not under the condition that the first display event is not monitored and the second display event is monitored, wherein the first ending event represents unloading of the mask layer, and the second ending event represents preset change of the state of the preset container; The monitoring result generation module is used for generating bullet layer monitoring information under the condition that the first ending event or the second ending event is monitored, wherein the bullet layer monitoring information comprises at least one piece of preset information of the bullet layer monitored at this time.
- 9. The apparatus as recited in claim 8, further comprising: And the rule acquisition module is used for acquiring a target monitoring rule, wherein the target monitoring rule comprises a rule for defining at least one of the first display event, the second display event, the first ending event and the second ending event.
- 10. The apparatus of claim 8, wherein the bullet layer monitoring information includes a duration indicating a duration of display of the bullet layer currently monitored in the target page; The apparatus further comprises: the timing module is used for starting a preset timer under the condition that a preset display event is monitored, starting timing, and closing the preset timer under the condition that the first end event or the second end event is monitored, and stopping timing; the monitoring result generation module is used for determining the duration according to the timing duration of the preset timer.
- 11. The apparatus of claim 10, wherein the bullet layer monitoring information further comprises a report control tag; The monitoring result generation module is used for judging whether the duration exceeds a preset threshold value, setting the reporting control tag to a first tag value for indicating that the reporting of the bullet layer monitoring information is forbidden under the condition that the duration exceeds the preset threshold value, and setting the reporting control tag to a second tag value for indicating that the reporting of the bullet layer monitoring information is allowed under the condition that the duration does not exceed the preset threshold value; The device also comprises a reporting module, a preset analysis system and a control module, wherein the reporting module is used for reporting the bullet layer monitoring information to the preset analysis system under the condition that the reporting control label is the second label value.
- 12. An electronic device, the electronic device comprising: A memory for storing a computer program; a processor for executing a computer program stored in said memory, and which, when executed, implements the method of any of the preceding claims 1-7.
- 13. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer program instructions, which when executed, implement the method of any of the preceding claims 1-7.
Description
Spring layer monitoring method and device Technical Field One or more embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for monitoring an elastic layer. Background An elastic layer, which is an interactive component, can be overlaid on top of the page body for displaying information, performing interactive operations, or highlighting specific content, etc. Different forms of content, such as text, buttons, lists, labels, form items, etc., can be presented through a bullet layer, typically for displaying advertisements, confirming operations, or gathering input, depending on different display requirements. A In an actual application scene, the bullet layer appearing in the page needs to be monitored in view of content safety, user experience, compliance and other aspects. For example, by monitoring content presented in the bullet layer, the bullet layer presenting illegal advertisements and sensitive data is intercepted, and illegal or malicious content can be prevented from spreading. For another example, by monitoring the interactive operation between the user and the bullet layer, whether the user is disliked of the appearance of the corresponding bullet layer can be analyzed, so that the related page or bullet layer is optimized based on the analysis result, and the user experience is improved. In the related art, the elastic layer in the page is usually monitored by a buried point technology, that is, a code for collecting and reporting the elastic layer information needs to be inserted into the source code of the related page. However, due to various types of the spring layers, display or hiding conditions and the like, different embedded point SDKs may need to be written for different pages and different spring layers, so that the method is poor in universality, high in cost and easy to cause omission, and monitoring accuracy is affected. Disclosure of Invention One or more embodiments of the present disclosure provide a method and an apparatus for monitoring an elastic layer, so as to reduce the cost of monitoring an elastic layer in a page and improve the accuracy of monitoring. In a first aspect, one or more embodiments of the present disclosure provide an elastic layer monitoring method, including: Monitoring whether a preset display event occurs in a target page or not, wherein the preset display event comprises a first display event which indicates that a mask layer occurs in the target page and a second display event which indicates that a preset container occurs in the target page, and the preset container is used for bearing an elastic layer; monitoring whether a first ending event occurs in the target page or not under the condition that the first display event is monitored, wherein the first ending event represents unloading of the mask layer; Monitoring whether a second ending event occurs in the target page or not under the condition that the first display event is not monitored and the second display event is monitored, wherein the second ending event represents that the state of the preset container is subjected to preset change; and under the condition that the first ending event or the second ending event is monitored, generating bullet layer monitoring information, wherein the bullet layer monitoring information comprises at least one piece of preset information of the bullet layer monitored at this time. According to the technical scheme, buried points in the target page are not needed, different monitoring modes are not needed to be customized for different types of bullet layers such as Modal, drawer, message, uniform monitoring of the bullet layers of different types can be achieved based on the mask layer or the container for bearing the bullet layers, the target page is not invaded, the method can be applied to any page with different patterns and different services, the method has strong stability and universality, bullet layer monitoring cost can be reduced, and the comprehensiveness and accuracy of bullet layer monitoring are improved. In addition, based on appearance and uninstallation of the shade layer, the life cycle of various shade bullet layers is monitored, display time drift caused by the difference of implementation modes of different types of bullet layers can be eliminated, unified monitoring of display time of different types of shade bullet layers is ensured, accuracy and uniformity of bullet layer monitoring information such as duration are improved, and accuracy of analysis results based on bullet layer monitoring information can be improved. In a possible implementation manner, the method further includes: A target monitoring rule is obtained, wherein the target monitoring rule includes a rule defining at least one of the first display event, the second display event, the first end event, and the second end event. In the technical scheme, the bullet layer monitoring is carrie