CN-122019906-A - Page abnormality judging method, device, equipment, medium and program product
Abstract
The invention relates to the technical field of front-end development, and discloses a method, a device, equipment, a medium and a program product for judging page abnormality, wherein a document object model node and a document object model element of a target page are obtained, and the target node is screened out from the document object model nodes according to service data corresponding to the target page; carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, and carrying out semantic analysis on document object model elements in each target node to obtain semantic analysis results; and determining whether the target page is abnormal or not based on the structural feature analysis result and/or the semantic analysis result. The method and the device perform structural feature analysis on the target node to capture structural distortion caused by compatibility, dynamic loading or rendering errors, break through the limitation that visual comparison is lagged and is easily affected by UI iteration, and perform semantic analysis on DOM elements in the node to make up for the defects of narrow attribute monitoring range and low accuracy.
Inventors
- XIONG XU
- LIU QINGSHENG
- YU YANG
Assignees
- 网易支付(杭州)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251229
Claims (10)
- 1. The method for judging the page abnormality is characterized by comprising the following steps: Acquiring a document object model node and a document object model element of a target page, and screening out a target node from the document object model node according to business data corresponding to the target page; Carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, and carrying out semantic analysis on the document object model elements in each target node to obtain semantic analysis results; And determining whether the target page is abnormal or not based on the structural feature analysis result and/or the semantic analysis result.
- 2. The method according to claim 1, wherein the performing structural feature analysis on the target node according to a preset metric to obtain a structural feature analysis result includes: acquiring a first structural feature of the target node, and matching the first structural feature with a first reference feature; If the matching is successful, calculating at least one second structural feature of the target page, calculating an error rate between the second structural feature and a second reference feature, and comparing the error rate with a first threshold; If the error rate is smaller than or equal to the first threshold value, uploading the second structural feature to a server; Calculating a statistical fluctuation range of the second structural feature based on historical statistical data of the second structural feature in the server; judging whether the second structural feature of the target page exceeds the statistical fluctuation range, and if so, judging that the target page is abnormal.
- 3. The method of claim 2, wherein the obtaining the first structural feature of the target node and matching the first structural feature with a first reference feature comprises: Obtaining a hash value of the target node, wherein the first reference characteristic is a reference hash value; And matching the hash value of the target node with the reference hash value.
- 4. The method of claim 2, wherein the second structural features include a density distribution index and a depth index, wherein the calculating at least one second structural feature of the target page and calculating an error rate between the second structural feature and a second reference feature, comparing the error rate to a first threshold, comprises: Calculating a density distribution index and a depth index of the target page, and calculating a first error value between the density distribution index and a reference density distribution and a second error value between the depth index and a reference depth index at each target node; and comparing the first error value and the second error value with a first threshold value respectively.
- 5. The method of claim 2, wherein the calculating a statistical fluctuation range of the second structural feature based on historical statistical data of the second structural feature in the server comprises: Acquiring historical statistical data of the second structural feature from the server, and calculating the mean value and standard deviation of the historical statistical data; And generating a statistical fluctuation range of the second structural feature according to the mean value and the standard deviation.
- 6. The method according to claim 1, wherein the performing semantic analysis on the document object model element in each target node to obtain a semantic analysis result includes: acquiring a node identifier of each target node; Judging whether the attribute of the document object model element is correct or not according to the node identification in each target node; In each target node, acquiring the number of the document object model elements visible to a user, and judging whether the number of the document object model elements is in a normal number range; And in each target node, acquiring the current position of the document object model element visible by the user, and judging whether the current position of the document object model element is correct or not.
- 7. A device for determining abnormality of a page, the device comprising: The acquisition module is used for acquiring the document object model nodes and the document object model elements of the target page and screening target nodes from the document object model nodes according to the service data corresponding to the target page; the analysis module is used for carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, and carrying out semantic analysis on the document object model elements in each target node to obtain semantic analysis results; And the judging module is used for determining whether the target page is abnormal or not based on the structure analysis result and/or the semantic analysis result.
- 8. An electronic device, comprising: A memory and a processor, the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the method for judging page abnormality according to any one of claims 1 to 6.
- 9. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the method of determining a page abnormality according to any one of claims 1 to 6.
- 10. A computer program product comprising computer instructions for causing a computer to perform the method of determining a page fault as claimed in any one of claims 1 to 6.
Description
Page abnormality judging method, device, equipment, medium and program product Technical Field The disclosure relates to the technical field of front-end development, in particular to a method, a device, equipment, a medium and a program product for judging page abnormality. Background In the related art, detection of abnormal display of a webpage mainly depends on two paths, namely, a visual comparison scheme based on image recognition, which is used for judging the abnormality by periodically capturing images of the webpage and performing difference analysis based on pixel sampling, and a scheme based on attribute state monitoring, which is used for judging the abnormality by collecting attribute values related to webpage rendering to establish a state set and according to consistency of attribute change. The former can capture the deviation of visual level, but it relies on high frequency screenshot and pixel level comparison, processing speed is slow, performance cost is obvious, and is difficult to accurately define abnormal boundary, and simultaneously UI iteration can lead to historical image baseline failure, and sustainability is poor. The latter can realize monitoring of the code level, but its application scope is limited to projects employing a specific data driven framework, and not all properties are strongly correlated with visual rendering, resulting in insufficient monitoring coverage and limited accuracy. That is, the related art cannot realize low-loss and real-time active detection in the face of page display abnormality caused by compatibility, dynamic rendering or non-code errors, and also cannot maintain a stable and effective judgment standard in UI continuous evolution. Therefore, a large number of anomalies cannot be found in time, and the feedback of a user is often passively relied on, so that the problem exposure is delayed, the repair period is prolonged, and the user experience is reduced. Disclosure of Invention The disclosure provides a method, a device, equipment, a medium and a program product for judging page abnormality, which are used for solving the problem of how to actively detect page display abnormality caused by compatibility, dynamic rendering or non-code errors. In a first aspect, the present disclosure provides a method for determining a page abnormality, where the method includes: Acquiring a document object model node and a document object model element of a target page, and screening out a target node from the document object model node according to business data corresponding to the target page; Carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, and carrying out semantic analysis on the document object model elements in each target node to obtain semantic analysis results; And determining whether the target page is abnormal or not based on the structural feature analysis result and/or the semantic analysis result. The method comprises the steps of obtaining document object model nodes and document object model elements of a target page, screening out the target nodes from the document object model nodes according to business data corresponding to the target page, carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, carrying out semantic analysis on the document object model elements in each target node to obtain semantic analysis results, and determining whether the target page is abnormal or not based on the structural feature analysis results and/or the semantic analysis results. The method and the device for analyzing the structural characteristics of the target node are used for analyzing the structural characteristics of the target node to capture the structural distortion problem caused by compatibility, dynamic loading or rendering errors, break through the limitation that visual comparison is lagged and is easily affected by UI iteration, and are used for carrying out semantic analysis on DOM elements in the node, so that the verification of element functions, states and content compliance is realized, and the defects of narrow attribute monitoring range and low accuracy are overcome. In a second aspect, the present disclosure provides a device for determining a page abnormality, where the device includes: The acquisition module is used for acquiring the document object model nodes and the document object model elements of the target page and screening target nodes from the document object model nodes according to the service data corresponding to the target page; the analysis module is used for carrying out structural feature analysis on the target nodes according to preset measurement indexes to obtain structural feature analysis results, and carrying out semantic analysis on the document object model elements in each target node to obtain semantic analysis r