Search

CN-121996447-A - Page abnormality detection method, device, equipment and computer storage medium

CN121996447ACN 121996447 ACN121996447 ACN 121996447ACN-121996447-A

Abstract

The application discloses a method, a device and equipment for detecting page abnormality and a computer storage medium, and relates to the technical field of page detection. The method comprises the steps of firstly obtaining a DOM structure tree and performance parameters of a page to be detected, wherein the DOM structure tree comprises a plurality of text label nodes and text lengths among the text label nodes, calculating the path length sum of the DOM structure tree according to the text label nodes and the text lengths under the condition that the page to be detected is not loaded for the first time, clustering the page to be detected based on the path length sum, the performance parameters and preset reference pages to determine a target reference page, calculating vector distances between the page to be detected and the target reference page, wherein the vector is a vector formed by the path length sum and the performance parameters, and judging the page to be detected to be an abnormal page under the condition that the vector distance is larger than a set threshold. When the embodiment of the application is used for detecting, the reference page is adjusted according to the real-time change of the page, so that the accuracy of page abnormality detection is improved.

Inventors

  • ZHOU BENWEN
  • CHEN RUSHI

Assignees

  • 中国移动通信集团安徽有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (10)

  1. 1. A method for detecting page faults, comprising: Acquiring a Document Object Model (DOM) structure tree and performance parameters of a page to be detected, wherein the DOM structure tree comprises a plurality of text label nodes and text lengths among the text label nodes; Under the condition that the page to be detected is not loaded for the first time, calculating the path length sum of the DOM structure tree according to the text label node and the text length, wherein the path is formed by connecting the text label node; Clustering the pages to be detected based on the path length sum, the performance parameter and a preset reference page, and determining a target reference page; Calculating the vector distance between the page to be detected and the target reference page, wherein the vector is formed by the path length and the performance parameter; And judging that the page to be detected is an abnormal page under the condition that the vector distance is larger than a set threshold value.
  2. 2. The method of page fault detection according to claim 1, further comprising: Judging whether the DOM structure tree and the performance parameters meet the set conditions or not under the condition that the page to be detected is loaded for the first time; And taking the page to be detected as a preset reference page under the condition that the DOM structure tree and the performance parameters meet the set conditions.
  3. 3. The method for detecting the page abnormality according to claim 1, wherein the clustering the pages to be detected based on the path length sum, the performance parameter and a preset reference page, determining a target reference page includes: Acquiring path length and performance parameters of a detected page corresponding to the page to be detected; taking a preset reference page vector as an initial clustering center; Calculating vector average values of the page to be detected and the detected page, and taking the vector average values as target clustering centers; and calculating the vector distance between the page to be detected and the detected page and the target clustering center, and taking the page with the shortest distance from the target clustering center as a target reference page.
  4. 4. A method of page fault detection as claimed in claim 3, further comprising: and taking the vector of the page to be detected as a new clustering center under the condition that the vector distance from the vector of the page to be detected to the target clustering center exceeds a set threshold value.
  5. 5. The method of page fault detection according to claim 1, further comprising: acquiring page pattern characteristics of the page to be detected and the target reference page under the condition that the vector distance between the page to be detected and the target reference page does not exceed a set threshold value; determining a target pattern feature difference value of the page to be detected and the target reference page based on the page pattern features of the page to be detected and the target reference page; And judging that the page to be detected is an abnormal page under the condition that the characteristic difference value of the target pattern is larger than a set threshold value.
  6. 6. The method for detecting the page fault according to claim 5, wherein the page pattern features include a color histogram feature, a direction gradient histogram feature, and an average absolute value deviation feature, and the calculating the page pattern feature difference value of the page to be detected and the target reference page based on the page pattern features of the page to be detected and the target reference page includes: Splicing and fusing the color histogram features, the direction gradient histogram features and the average absolute value deviation features to obtain target pattern features of a page to be detected and a target reference page respectively; And determining a target pattern characteristic difference value according to the relation between the pattern characteristics of the page to be detected and the target reference page and the pattern characteristic difference value based on the target pattern characteristics of the page to be detected and the target reference page.
  7. 7. An apparatus for detecting page faults, the apparatus comprising: The system comprises an acquisition module, a detection module and a detection module, wherein the acquisition module is used for acquiring a Document Object Model (DOM) structure tree and performance parameters of a page to be detected, and the DOM structure tree comprises a plurality of text label nodes and text lengths among the text label nodes; The calculation module is used for calculating the path length sum of the DOM structure tree according to the text label node and the text length under the condition that the page to be detected is not loaded for the first time, wherein the path is formed by connecting the text label node; the clustering module is used for clustering the pages to be detected based on the path length sum, the performance parameter and a preset reference page, and determining a target reference page; the calculation module is also used for calculating the vector distance between the page to be detected and the target reference page, wherein the vector is formed by the path length and the performance parameters; And the judging module is used for judging that the page to be detected is an abnormal page under the condition that the vector distance is larger than a set threshold value.
  8. 8. A terminal device, characterized in that the device comprises a processor and a memory storing computer program instructions, the processor implementing the method of page fault detection according to any of claims 1-6 when executing the computer program instructions.
  9. 9. A computer readable storage medium having stored thereon computer program instructions which when executed by a processor implement the method of page fault detection as claimed in any one of claims 1 to 6.
  10. 10. A computer program product, characterized in that instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the method of page fault detection according to any of claims 1-6.

Description

Page abnormality detection method, device, equipment and computer storage medium Technical Field The application belongs to the technical field of page detection, and particularly relates to a method, a device, equipment and a computer storage medium for detecting page abnormality. Background With the continuous development of the internet, the fifth generation hypertext markup language (Hyper Text Markup Language.0, H5) page plays an increasingly important role in enterprise services and user interaction, and anomaly detection for H5 pages is also becoming an urgent requirement. The existing page abnormality detection method is used for comparing the mixed characteristic values of characters and patterns based on a preset static comparison standard when the page is loaded, but because the H5 page is loaded by asynchronous data and the content changes in real time according to user interaction, abnormality detection can not be carried out on the content displayed after the page is loaded according to the requirement in the H5 page, and the page abnormality detection accuracy is lower. Disclosure of Invention The embodiment of the application provides a method, a device, equipment and a computer storage medium for detecting page abnormality, which are used for solving the problem of lower accuracy of page abnormality detection in the prior art. In a first aspect, an embodiment of the present application provides a method for detecting a page exception, where the method includes: acquiring a Document Object Model (DOM) structure tree and performance parameters of a page to be detected, wherein the DOM structure tree comprises a plurality of text label nodes and text lengths among the text label nodes; Under the condition that a page to be detected is not loaded for the first time, calculating the path length sum of the DOM structure tree according to the text label node and the text length, wherein the path is formed by connecting the text label node; clustering pages to be detected based on the path length sum, the performance parameter and a preset reference page, and determining a target reference page; calculating vector distances between a page to be detected and a target reference page, wherein the vector is formed by path length and performance parameters; and judging the page to be detected as an abnormal page under the condition that the vector distance is larger than the set threshold value. In a second aspect, an embodiment of the present application provides an apparatus for detecting a page abnormality, where the apparatus includes: The system comprises an acquisition module, a detection module and a detection module, wherein the acquisition module is used for acquiring a Document Object Model (DOM) structure tree and performance parameters of a page to be detected, and the DOM structure tree comprises a plurality of text label nodes and text lengths among the text label nodes; The calculation module is used for calculating the path length sum of the DOM structure tree according to the text label node and the text length under the condition that the page to be detected is not loaded for the first time, wherein the path is formed by connecting the text label node; the clustering module is used for clustering the pages to be detected based on the path length sum, the performance parameter and the preset reference page, and determining a target reference page; The calculation module is also used for calculating the vector distance between the page to be detected and the target reference page, wherein the vector is formed by the path length and the performance parameters; And the judging module is used for judging that the page to be detected is an abnormal page under the condition that the vector distance is larger than the set threshold value. In a third aspect, an embodiment of the present application provides a terminal device, where the device includes a processor and a memory storing computer program instructions, and where the processor executes the computer program instructions to implement a method for detecting a page abnormality as in the first aspect. In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of page fault detection as in the first aspect. In a fifth aspect, embodiments of the present application provide a computer program product, instructions in which, when executed by a processor of an electronic device, cause the electronic device to perform a method of page fault detection as in the first aspect. The embodiment of the application provides a method, a device, equipment and a computer storage medium for detecting page abnormality. The method comprises the steps of obtaining a Document Object Model (DOM) structure tree and performance parameters of a page to be detected, wherein the DOM structure tree comprises a pluralit