CN114579420A - A kind of page difference detection method and system - Google Patents

A kind of page difference detection method and system Download PDF

Info

Publication number
CN114579420A
CN114579420A CN202011373863.5A CN202011373863A CN114579420A CN 114579420 A CN114579420 A CN 114579420A CN 202011373863 A CN202011373863 A CN 202011373863A CN 114579420 A CN114579420 A CN 114579420A
Authority
CN
China
Prior art keywords
page
difference detection
information
detected
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011373863.5A
Other languages
Chinese (zh)
Inventor
夏博
张芮恺
宋亚龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202011373863.5A priority Critical patent/CN114579420A/en
Publication of CN114579420A publication Critical patent/CN114579420A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a page difference detection method and a page difference detection system. The page difference detection system can acquire the page to be detected, the standard page and a target detection mode determined by a user, then extracts page structure information and/or page element semantic information in the page to be detected and the standard page, and realizes difference detection of the page to be detected based on the target detection mode and the page structure information and/or page element semantic information in the page to be detected and the standard page. In the method, a user can independently select a difference detection mode, the diversified requirements of the user on page difference detection are effectively met, difference detection is carried out on the page to be detected based on page structure information and/or page element semantic information in the page to be detected and the standard page, background information is not needed, the accuracy of page difference detection is effectively improved, and the granularity range of page difference detection is effectively expanded.

Description

一种页面差异检测方法及系统A kind of page difference detection method and system

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种页面差异检测方法及系统。The present application relates to the field of computer technology, and in particular, to a method and system for detecting page differences.

背景技术Background technique

在软件产品开发之后,通常需要对软件产品的图形用户界面(graphical userinterface, GUI)进行页面差异检测,即检测软件产品在不同环境(例如,不同操作系统、浏览器、设备所组合的环境)中所显示的页面与该软件产品的标准页面的是否存在差异。After the software product is developed, it is usually necessary to perform page difference detection on the graphical user interface (GUI) of the software product, that is, to detect the software product in different environments (for example, environments in which different operating systems, browsers, and devices are combined) Whether the displayed page is different from the standard page of the software product.

目前页面差异检测主要采用两种方式,方式1为:通过检测同一软件产品在标准环境、和待测环境中显示的后台信息(例如,代码信息)的差异来确定待检测页面与标准页面的差异;方式2为:通过检测同一软件产品的待检测页面与标准页面的像素差异,来确定待检测页面与标准页面的差异。方式1依赖于后台信息,获取难度大,且后台代码信息的差异并不能有效代表页面差异,所以会导致差异检测结果精度低;方式2检测方式单一(仅检测像素差异),不能有效满足用户需求。At present, there are mainly two methods for page difference detection. Method 1: Determine the difference between the page to be detected and the standard page by detecting the difference between the background information (for example, code information) displayed by the same software product in the standard environment and the environment to be tested. ; Method 2: Determine the difference between the to-be-detected page and the standard page by detecting the pixel difference between the to-be-detected page and the standard page of the same software product. Method 1 relies on background information, which is difficult to obtain, and the difference in background code information cannot effectively represent page differences, so it will lead to low accuracy of difference detection results; Method 2 has a single detection method (only pixel differences are detected), which cannot effectively meet user needs. .

发明内容SUMMARY OF THE INVENTION

本申请提供了一种页面差异检测方法,用以提升页面差异检测的精度,在该方法中,用户可以自主选择差异检测模式,有效满足用户对页面差异检测的多样化需求。本申请还提供了上述方法对应的系统、设备、计算机可读存储介质以及计算机程序产品。The present application provides a page difference detection method to improve the accuracy of page difference detection. In this method, a user can independently select a difference detection mode, which effectively meets the user's diverse needs for page difference detection. The present application also provides systems, devices, computer-readable storage media, and computer program products corresponding to the above methods.

第一方面,提供一种页面差异检测方法,该方法可以由页面差异检测系统执行。在该方法中,页面差异检测系统获取待检测页面和标准页面,并对待检测页面和标准页面进行处理,获得待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及标准页面的第二页面结构信息和/或第二页面元素语义信息;然后,页面差异检测系统还可以获取用户确定的目标检测模式;根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、以及第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测,获得第一差异检测结果。In a first aspect, a page difference detection method is provided, and the method can be executed by a page difference detection system. In this method, the page difference detection system acquires the page to be detected and the standard page, and processes the page to be detected and the standard page to obtain the first page structure information and/or the semantic information of the first page element of the page to be detected, and the standard page the second page structure information and/or the second page element semantic information; then, the page difference detection system can also obtain the target detection mode determined by the user; according to the target detection mode, the first page structure information and/or the first page element semantics information, and the second page structure information and/or the second page element semantic information, and perform difference detection on the page to be detected to obtain a first difference detection result.

在本申请实施例的技术方案中,页面差异检测系统可以根据用户确定的目标检测模式、在待检测页面中确定出的第一页面结构信息和/或第一页面元素语义信息、在标准页面中确定出的第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测。如此,有效满足用户对页面差异检测的多样化需求,又有效提升页面差异检测的精度。In the technical solutions of the embodiments of the present application, the page difference detection system can be based on the target detection mode determined by the user, the first page structure information and/or the first page element semantic information determined in the page to be detected, and the first page element semantic information in the standard page. The determined second page structure information and/or the second page element semantic information is used for difference detection on the page to be detected. In this way, the user's diverse needs for page difference detection are effectively met, and the accuracy of page difference detection is effectively improved.

在一种可能的设计中,目标检测模式包括以下模式中的一种或多种:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式。In a possible design, the object detection mode includes one or more of the following modes: pixel alignment mode, page element semantic alignment mode, page layout alignment mode, and custom alignment mode.

在该设计中,提供了多种用于进行页面差异检测的比对模式,有效满足用户多样化页面差异检测需求。In this design, a variety of comparison modes for page difference detection are provided, which effectively meet the user's diverse page difference detection needs.

在一种可能的设计中,当用户确定的目标检测模式包括页面元素语义比对模式时,页面差异检测系统对待检测页面进行差异检测,获得第一差异检测结果,具体的具体实施方式可以是:比较第一页面元素语义信息与第二页面元素语义信息,确定第一差异检测结果。In a possible design, when the target detection mode determined by the user includes the page element semantic comparison mode, the page difference detection system performs difference detection on the page to be detected, and obtains the first difference detection result. The specific implementation may be: The first difference detection result is determined by comparing the semantic information of the first page element with the semantic information of the second page element.

在该设计中,页面差异检测系统通过对待检测页面和标准页面的页面元素语义信息进行比对,有效扩大页面差异检测的检测粒度,进而有效提升页面差异检测的准确度。In this design, the page difference detection system effectively expands the detection granularity of page difference detection by comparing the page element semantic information of the page to be detected and the standard page, thereby effectively improving the accuracy of page difference detection.

在一种可能的设计中,第一页面结构信息包括待检测页面中的页面元素的样式、位置或类型中的至少一个,第二页面结构信息包括标准页面中的页面元素的样式、位置或类型中的至少一个;当用户确定的目标检测模式包括页面布局比对模式时,页面差异检测系统对待检测页面进行差异检测,获得第一差异检测结果,可以是:比较第一页面结构信息和第二页面结构信息,来确定差异检测结果,确定第一差异检测结果。In a possible design, the first page structure information includes at least one of the style, position or type of page elements in the page to be detected, and the second page structure information includes the style, position or type of page elements in standard pages At least one of; when the target detection mode determined by the user includes the page layout comparison mode, the page difference detection system performs difference detection on the page to be detected, and obtains the first difference detection result, which may be: comparing the first page structure information with the second difference detection result. The page structure information is used to determine the difference detection result, and the first difference detection result is determined.

其中,页面差异检测系统通过比较第一页面结构信息和第二页面结构信息,确定第一差异检测结果的具体实施方式有多种,包括但不限于以下三种:There are various specific implementations for the page difference detection system to determine the first difference detection result by comparing the first page structure information and the second page structure information, including but not limited to the following three:

方式1,统计待检测页面中第一页面元素与标准页面中至少一个样式、类型均相同的第一页面元素与第二页面元素的位置差异程度。Manner 1: Count the degree of positional difference between the first page element in the page to be detected and the first page element and the second page element that have the same style and type in at least one of the standard pages.

方式2,统计待检测页面与标准页面中至少一个位置、类型均相同的第一页面元素与第二页面元素的样式差异程度。Method 2: Count the degree of style difference between the first page element and the second page element that have at least one position and type in the to-be-detected page and the standard page.

方式3,统计待检测页面与标准页面中至少一个位置、样式均相同的第一页面元素与第二页面元素的类型差异程度。Manner 3: Count the degree of difference between the types of the first page element and the second page element that have the same position and style in at least one of the page to be detected and the standard page.

应理解,第一页面元素可以是待检测页面中的任一页面元素,第二页面元素为该任一页面元素在标准页面中对应的页面元素。方式1和方式2中的第一页面元素和第二页面元素的位置相同可以是完全相同也可以是部分相同(例如,80%的位置相同),本申请实施例不作具体的限定。It should be understood that the first page element may be any page element in the page to be detected, and the second page element is the page element corresponding to the any page element in the standard page. The positions of the first page element and the second page element in Modes 1 and 2 may be identical or partially the same (for example, 80% of the positions are the same), which is not specifically limited in this embodiment of the present application.

在该设计中,页面差异检测系统通过对待检测页面和标准页面的页面结构信息进行比对,来确定差异检测结果,有效扩大页面差异检测的检测粒度,进而有效提升页面差异检测的准确度。In this design, the page difference detection system determines the difference detection result by comparing the page structure information of the page to be detected and the standard page, which effectively expands the detection granularity of page difference detection, thereby effectively improving the accuracy of page difference detection.

在一种可能的设计中,当用户确定的目标检测模式包括自定义比对模式时,页面差异检测系统对待检测页面进行差异检测,获得第一差异检测结果,还可以接收第一命令或第一操作,根据第一命令或第一操作确定用户关注的差异类型;其中,差异类型包括像素、页面元素语义、页面结构中的一种或多种;进而页面差异检测系统确定待检测页面中差异类型对应的第一信息,以及标准页面中差异类型对应的第二信息;根据第一信息和第二信息,确定第一差异检测结果。In a possible design, when the target detection mode determined by the user includes a custom comparison mode, the page difference detection system performs difference detection on the page to be detected, obtains a first difference detection result, and can also receive a first command or a first operation, according to the first command or the first operation to determine the difference type concerned by the user; wherein, the difference type includes one or more of pixels, page element semantics, and page structure; and then the page difference detection system determines the difference type in the page to be detected. The corresponding first information, and the second information corresponding to the difference type in the standard page; the first difference detection result is determined according to the first information and the second information.

在该设计中,用户可以自主选择关注的差异类型,页面差异检测系统通过对待检测页面和标准页面中该差异类型对应的第一信息和第二信息进行比对,来确定差异检测结果,即有效满足用户多样化的差异检测需求,又有效提升页面差异检测的准确度。In this design, the user can independently select the type of difference to focus on, and the page difference detection system determines the difference detection result by comparing the first information and the second information corresponding to the difference type in the page to be detected and the standard page to determine the difference detection result, that is, effective It meets the diverse needs of users for difference detection, and effectively improves the accuracy of page difference detection.

在一种可能的设计中,待检测页面为待测网页的第一图形用户界面GUI截图,标准页面为待测网页的标准GUI截图。In a possible design, the page to be tested is a screenshot of the GUI of the first graphical user interface of the web page to be tested, and the standard page is a screenshot of the standard GUI of the web page to be tested.

应理解,第一GUI截图待检测页面可以是待测网页在不同环境下的图形用户界面(graphical user interface,GUI)截图,即第一GUI截图可以是一个截图或多个GUI截图的集合,这里,不作具体的限定。其中,环境可以理解为操作系统、硬件设备、或网页浏览器以及对应网页浏览器的版本中的一种或多种所组合的环境。标准GUI截图具体可以是预先设计的GUI截图,也可以是在用户指定环境(例如,视窗操作(windows)系统的谷歌浏览器)下该待测网页所显示的GUI截图。It should be understood that the first GUI screenshot of the page to be detected may be a graphical user interface (graphical user interface, GUI) screenshot of the webpage to be tested in different environments, that is, the first GUI screenshot may be a screenshot or a collection of multiple GUI screenshots, here , without any specific limitation. Wherein, the environment may be understood as an environment combined with one or more of an operating system, a hardware device, or a web browser and a version of the corresponding web browser. The standard GUI screenshot may specifically be a pre-designed GUI screenshot, or may be a GUI screenshot displayed by the web page to be tested under a user-specified environment (eg, Google Chrome of a Windows operating system).

在该设计中,页面差异检测系统可以对待测网页在不同环境的GUI截图进行检测,有效提升页面差异检测的效率。In this design, the page difference detection system can detect the GUI screenshots of the webpage under test in different environments, which effectively improves the efficiency of page difference detection.

需要说明的是,页面差异检测系统获取待检测页面和标准页面,有多种实现方式,包括但不限于以下两种:It should be noted that the page difference detection system obtains the page to be detected and the standard page, and there are multiple implementations, including but not limited to the following two:

方式1,接收用户上传的第一GUI截图(即待测GUI截图)和标准GUI截图。Mode 1: Receive the first GUI screenshot (ie, the GUI screenshot to be tested) and the standard GUI screenshot uploaded by the user.

方式2,获取用户输入的网页链接和/或网页链接所对应的网页页面中的超链接;基于网页链接和/或超链接,生成第一GUI截图和标准GUI截图。Method 2: Obtain the web page link input by the user and/or the hyperlink in the web page corresponding to the web page link; generate the first GUI screenshot and standard GUI screenshot based on the web page link and/or the hyperlink.

在一种可能的设计中,页面差异检测系统对待检测页面进行差异检测,获得第一差异检测结果之后,还可以输出第一差异检测结果。其中,第一差异检测结果可以包括待测页面的像素差异信息、结构差异信息、语义差异信息中的至少一项。In a possible design, the page difference detection system performs difference detection on the page to be detected, and after obtaining the first difference detection result, it can also output the first difference detection result. The first difference detection result may include at least one item of pixel difference information, structural difference information, and semantic difference information of the page to be tested.

在该设计中,页面差异检测系统输出第一差异检测结果,使得用户可以直观地确定待检测页面和标准页面的差异之处。In this design, the page difference detection system outputs the first difference detection result, so that the user can intuitively determine the difference between the page to be detected and the standard page.

在一种可能的设计中,页面差异检测系统可以通过深度学习模型对待检测页面和标准页面进行处理,具体的,页面差异检测系统可以对海量网页在不同环境下的GUI截图进行训练,得到深度学习模型;其中,深度学习模型的输入为任一GUI截图,输出为任一GUI 截图中的页面结构信息和/或页面元素语义信息;并且在得到深度学习模型之后,页面差异检测系统可以将待检测页面输入深度学习模型,基于深度学习模型输出第一页面结构信息和/或第一页面元素语义信息;以及,将标准页面输入深度学习模型,基于深度学习模型输出第二页面结构信息和/或第二页面元素语义信息。In a possible design, the page difference detection system can process the pages to be detected and standard pages through a deep learning model. Specifically, the page difference detection system can train GUI screenshots of massive web pages in different environments to obtain deep learning model; wherein, the input of the deep learning model is any GUI screenshot, and the output is the page structure information and/or page element semantic information in any GUI screenshot; and after obtaining the deep learning model, the page difference detection system can be detected. The page is input into the deep learning model, and based on the deep learning model, the first page structure information and/or the first page element semantic information is output; and, the standard page is input into the deep learning model, and the second page structure information and/or the first page structure information and/or the Two page element semantic information.

在该设计中,页面差异检测系统通过深度学习模型在待检测页面中确定出第一页面结构信息和/或第一页面元素语义信息,以及在标准页面中确定出第二页面结构信息和/或第二页面元素语义信息,有效提升页面特征识别的粒度范围和准确度。In this design, the page difference detection system determines the first page structure information and/or the first page element semantic information in the page to be detected through the deep learning model, and determines the second page structure information and/or the standard page in the standard page. The semantic information of the second page element can effectively improve the granularity range and accuracy of page feature recognition.

在一种可能的设计中,页面差异检测系统对待检测页面进行差异检测,获得第一差异检测结果之后,还可以:接收第二操作;根据第二操作在待检测页面中确定出用户关注的第一区域图像,以及在标准页面中确定出与第一区域图像对应的第二区域图像;确定第一区域图像与第二区域图像之间的第二差异检测结果;然后基于第一差异检测结果和第二差异检测结果,确定待检测页面与标准页面的第三差异检测结果,输出第三差异检测结果。In a possible design, the page difference detection system performs difference detection on the page to be detected, and after obtaining the first difference detection result, it can further: receive a second operation; an area image, and determine the second area image corresponding to the first area image in the standard page; determine the second difference detection result between the first area image and the second area image; then based on the first difference detection result and The second difference detection result is to determine the third difference detection result between the page to be detected and the standard page, and output the third difference detection result.

其中,第二差异检测结果包括第一区域图像与第二区域图像的像素差异信息、结构差异信息、语义差异信息中的至少一项。The second difference detection result includes at least one item of pixel difference information, structural difference information, and semantic difference information between the first area image and the second area image.

在该设计中,在页面差异检测系统基于用户确定的目标检测模式对待检测页面和标准页面进行差异检测的基础上,用户可以选择对待检测页面中的局部图像进行二次检测。如此,可以满足用户想要重点关注部分区域的差异情况的需求,进而有效提升用户体验。In this design, on the basis that the page difference detection system performs the difference detection between the page to be detected and the standard page based on the target detection mode determined by the user, the user can choose to perform secondary detection on the partial images in the page to be detected. In this way, it is possible to meet the needs of users who want to focus on differences in some areas, thereby effectively improving user experience.

第二方面,提供一种页面差异检测系统,示例性的,该页面差异检测系统可以包括:In a second aspect, a system for detecting page differences is provided. Exemplarily, the system for detecting page differences may include:

处理单元,用于获取待检测页面和标准页面,对待检测页面和标准页面进行处理,获得待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及标准页面的第二页面结构信息和/或第二页面元素语义信息;A processing unit, configured to acquire the page to be detected and the standard page, process the page to be detected and the standard page, and obtain the first page structure information and/or the semantic information of the first page element of the page to be detected, and the second page structure of the standard page information and/or second page element semantic information;

接口单元,用于获取用户确定的目标检测模式;an interface unit for acquiring the target detection mode determined by the user;

处理单元,还用于根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、以及第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测,获得第一差异检测结果。The processing unit is further configured to perform difference detection on the page to be detected according to the target detection mode, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information, and obtain The first difference detection result.

在一种可能的设计中,目标检测模式包括以下模式中的一种或多种:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式。In a possible design, the object detection mode includes one or more of the following modes: pixel alignment mode, page element semantic alignment mode, page layout alignment mode, and custom alignment mode.

在一种可能的设计中,当用户确定的目标检测模式包括页面元素语义比对模式时,处理单元在用于对待检测页面进行差异检测,获得第一差异检测结果时,具体用于:In a possible design, when the target detection mode determined by the user includes the page element semantic comparison mode, when the processing unit is used to perform difference detection on the page to be detected and obtain the first difference detection result, the processing unit is specifically used for:

比较第一页面元素语义信息与第二页面元素语义信息,确定第一差异检测结果。The first difference detection result is determined by comparing the semantic information of the first page element with the semantic information of the second page element.

在一种可能的设计中,第一页面结构信息包括待检测页面中的页面元素的样式、位置或类型中的至少一个,第二页面结构信息包括标准页面中的页面元素的样式、位置或类型中的至少一个;当用户确定的目标检测模式包括页面布局比对模式时,处理单元在用于对待检测页面进行差异检测,获得第一差异检测结果时,具体用于:In a possible design, the first page structure information includes at least one of the style, position or type of page elements in the page to be detected, and the second page structure information includes the style, position or type of page elements in standard pages At least one of; when the target detection mode determined by the user includes the page layout comparison mode, the processing unit is used to perform difference detection on the page to be detected and obtain the first difference detection result, and is specifically used for:

比较第一页面结构信息和第二页面结构信息,确定第一差异检测结果。The first difference detection result is determined by comparing the first page structure information with the second page structure information.

在一种可能的设计中,当用户确定的目标检测模式包括自定义比对模式时,在处理单元用于对待检测页面进行差异检测之前,接口单元还用于:接收第一命令或第一操作;处理单元还用于:根据第一命令或第一操作确定用户关注的差异类型;其中,差异类型包括像素、页面元素语义、页面结构中的一种或多种;处理单元在用于对待检测页面进行差异检测,获得第一差异检测结果时,具体用于:确定待检测页面中差异类型对应的第一信息,以及标准页面中差异类型对应的第二信息;根据第一信息和第二信息,确定第一差异检测结果。In a possible design, when the target detection mode determined by the user includes a user-defined comparison mode, before the processing unit is used to perform difference detection on the page to be detected, the interface unit is further configured to: receive a first command or a first operation The processing unit is also used to: determine the difference type that the user pays attention to according to the first command or the first operation; wherein, the difference type includes one or more of pixels, page element semantics, and page structure; the processing unit is used to detect The page performs difference detection, and when the first difference detection result is obtained, it is specifically used to: determine the first information corresponding to the difference type in the page to be detected, and the second information corresponding to the difference type in the standard page; according to the first information and the second information , and determine the first difference detection result.

在一种可能的设计中,待检测页面为待测网页的第一图形用户界面GUI截图,标准页面为待测网页的标准GUI截图。In a possible design, the page to be tested is a screenshot of the GUI of the first graphical user interface of the web page to be tested, and the standard page is a screenshot of the standard GUI of the web page to be tested.

在一种可能的设计中,处理单元在用于待检测页面和标准页面时,具体用于:获取用户输入的网页链接和/或网页链接所对应的网页页面中的超链接;基于网页链接和/或超链接,生成第一GUI截图和标准GUI截图。In a possible design, when the processing unit is used for the to-be-detected page and the standard page, it is specifically configured to: obtain the web page link input by the user and/or the hyperlink in the web page corresponding to the web page link; / or hyperlinks to generate first GUI screenshots and standard GUI screenshots.

在一种可能的设计中,处理单元在用于对待检测页面进行差异检测,获得第一差异检测结果之后,输出第一差异检测结果,第一差异检测结果包括待测页面的像素差异信息、结构差异信息、语义差异信息中的至少一项。In a possible design, the processing unit is configured to perform difference detection on the page to be detected, and after obtaining the first difference detection result, output the first difference detection result, where the first difference detection result includes pixel difference information and structure of the page to be tested. At least one item of difference information and semantic difference information.

在一种可能的设计中,处理单元在用于对待检测页面和标准页面进行处理之前,处理单元还用于对海量网页在不同环境下的GUI截图进行训练,得到深度学习模型;其中,深度学习模型的输入为任一GUI截图,输出为任一GUI截图中的页面结构信息和/或页面元素语义信息;处理单元在用于对待检测页面和标准页面进行处理时,具体用于:将待检测页面输入深度学习模型,基于深度学习模型输出第一页面结构信息和/或第一页面元素语义信息;以及,将标准页面输入深度学习模型,基于深度学习模型输出第二页面结构信息和/或第二页面元素语义信息。In a possible design, before the processing unit is used to process the page to be detected and the standard page, the processing unit is also used to train GUI screenshots of massive web pages in different environments to obtain a deep learning model; The input of the model is any GUI screenshot, and the output is page structure information and/or page element semantic information in any GUI screenshot; when the processing unit is used to process the page to be detected and the standard page, it is specifically used for: The page is input into the deep learning model, and based on the deep learning model, the first page structure information and/or the first page element semantic information is output; and, the standard page is input into the deep learning model, and the second page structure information and/or the first page structure information and/or the Two page element semantic information.

在一种可能的设计中,接口单元还用于:在处理单元对待检测页面进行差异检测,获得第一差异检测结果之后,接收第二操作;处理单元还用于:根据第二操作在待检测页面中确定出用户关注的第一区域图像,以及在标准页面中确定出与第一区域图像对应的第二区域图像;确定第一区域图像与第二区域图像之间的第二差异检测结果;第二差异检测结果包括第一区域图像与第二区域图像的像素差异信息、结构差异信息、语义差异信息中的至少一项;基于第一差异检测结果和第二差异检测结果,确定待检测页面与标准页面的第三差异检测结果;接口单元,还用于输出第三差异检测结果。In a possible design, the interface unit is further configured to: after the processing unit performs difference detection on the page to be detected, and obtains the first difference detection result, receiving the second operation; the processing unit is further configured to: perform the difference detection on the page to be detected according to the second operation. Determine the first area image that the user pays attention to in the page, and determine the second area image corresponding to the first area image in the standard page; determine the second difference detection result between the first area image and the second area image; The second difference detection result includes at least one item of pixel difference information, structural difference information, and semantic difference information between the first area image and the second area image; based on the first difference detection result and the second difference detection result, determine the page to be detected The third difference detection result with the standard page; the interface unit is also used for outputting the third difference detection result.

第三方面,提供一种计算设备,示例性的,该计算设备包括处理器、存储器;In a third aspect, a computing device is provided. Exemplarily, the computing device includes a processor and a memory;

处理器用于执行存储器中存储的指令,以使得设备执行如第一方面或第一方面中任一可能的设计中所述的方法。The processor is configured to execute instructions stored in the memory to cause the apparatus to perform the method as described in the first aspect or any possible design of the first aspect.

第四方面,提供一种计算机可读存储介质,包括指令,当其在计算设备上运行时,使得计算设备执行第一方面或第一方面中任一可能的设计中所述的方法。In a fourth aspect, a computer-readable storage medium is provided, comprising instructions that, when executed on a computing device, cause the computing device to perform the method described in the first aspect or any possible design of the first aspect.

上述第二方面至第四方面中任一方面可以达到的技术效果,具体可以参照上述第一方面中任意一种上述第二方面至第四方面中任一方面可以达到的技术效果,具体可以参照上述第一方面中任意一种可能的设计所带来的技术效果描述,这里不再赘述。For the technical effects that can be achieved in any of the above-mentioned second to fourth aspects, the specific technical effects that can be achieved in any of the above-mentioned first aspects can be referred to in any of the above-mentioned second to fourth aspects. The description of the technical effects brought about by any of the possible designs in the first aspect above will not be repeated here.

附图说明Description of drawings

图1为本申请实施例适用的一种系统架构示意图;FIG. 1 is a schematic diagram of a system architecture to which an embodiment of the present application is applicable;

图2为本申请实施例提供的一种图形用户界面的示意图;2 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图3A为本申请实施例提供的一种命令用户界面的示意图;3A is a schematic diagram of a command user interface provided by an embodiment of the present application;

图3B为本申请实施例提供的一种图形用户界面的示意图;3B is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图4为本申请实施例提供的一种页面差异检测方法的流程示意图;4 is a schematic flowchart of a method for detecting page differences provided by an embodiment of the present application;

图5为本申请实施例提供的一种图形用户界面的示意图;5 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图6为本申请实施例提供的一种图形用户界面的示意图;6 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图7为本申请实施例提供的模型训练的场景示意图;FIG. 7 is a schematic diagram of a model training scenario provided by an embodiment of the present application;

图8为本申请实施例提供的获取待检测页面和标准页面的特征信息的场景示意图;8 is a schematic diagram of a scenario for acquiring feature information of a page to be detected and a standard page according to an embodiment of the present application;

图9为本申请实施例提供的一种图形用户界面的示意图;9 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图10为本申请实施例提供的页面差异检测过程示意图;10 is a schematic diagram of a page difference detection process provided by an embodiment of the present application;

图11为本申请实施例提供的页面差异检测过程示意图;11 is a schematic diagram of a page difference detection process provided by an embodiment of the present application;

图12为本申请实施例提供的页面差异检测过程示意图;12 is a schematic diagram of a page difference detection process provided by an embodiment of the present application;

图13为本申请实施例提供的一种图形用户界面的示意图;13 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图14为本申请实施例提供的一种图形用户界面的示意图;14 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图15为本申请实施例提供的一种图形用户界面的示意图;15 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;

图16为本申请实施例提供的确定兼容性测试结果的过程示意图;16 is a schematic diagram of a process for determining a compatibility test result provided by an embodiment of the present application;

图17为本申请实施例提供的页面差异检测过程示意图;17 is a schematic diagram of a page difference detection process provided by an embodiment of the present application;

图18为本申请实施例提供的一种计算设备的结构示意图。FIG. 18 is a schematic structural diagram of a computing device according to an embodiment of the present application.

具体实施方式Detailed ways

本申请实施例中的术语至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c,a-b,a-c,b-c,或a-b-c中任意一种情况可以包括单个a、单个b、单个c,也可以包括多个a、多个b、多个c。In the embodiments of this application, the term "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three kinds of relationships, For example, A and/or B can mean that A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the associated object is a kind of " "or" relationship. "At least one of the following items" or similar expressions, refers to any combination of these items, including any combination of single item (item) or plural item (item). For example, a, b, Or at least one (one) of c, which can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where any of a, b, c, a-b, a-c, b-c, or a-b-c can be It includes a single a, a single b, and a single c, and can also include multiple a, multiple b, and multiple c.

以及,除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一优先级准则和第二优先级准则,只是为了区分不同的准则,而并不是表示这两种准则的内容、优先级或者重要程度等的不同。And, unless stated to the contrary, the ordinal numbers such as “first” and “second” mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, sequence, priority or priority of multiple objects. Importance. For example, the first priority criterion and the second priority criterion are only for distinguishing different criteria, and do not indicate the difference in content, priority, or importance of the two criteria.

此外,本申请实施例和权利要求书及附图中的术语“包括”和“具有”不是排他的。例如,包括了一系列步骤或模块/单元的过程、方法、系统、产品或设备,不限定于已列出的步骤或模块,还可以包括没有列出的步骤或模块/单元。In addition, the terms "comprising" and "having" in the embodiments and claims of the present application and the drawings are not exclusive. For example, a process, method, system, product or device that includes a series of steps or modules/units is not limited to the listed steps or modules, and may also include unlisted steps or modules/units.

随着计算机技术的不断发展,软件产品的类型越来越丰富。为了保证用户体验,软件产品在不同的环境中的GUI显示一致性尤为重要,因此对软件产品在不同的环境中的页面显示差异进行检测,有着迫切的需求和广泛的前景。With the continuous development of computer technology, the types of software products are becoming more and more abundant. In order to ensure user experience, the consistency of GUI display of software products in different environments is particularly important. Therefore, there is an urgent need and broad prospect to detect differences in page display of software products in different environments.

本申请实施例提供了一种页面差异检测方法,该方法可以由页面差异检测系统执行。页面差异检测系统通过用户界面例如图形用户界面(graphical user interface,GUI)或者命令用户界面(command user interface,CUI)等获取待检测页面和标准页面以及用户确定的目标检测模式,然后提取待检测页面和标准页面中的页面结构信息和/或页面元素语义信息,基于该目标检测模式以及待检测页面和标准页面中的页面结构信息和/或页面元素语义信息,实现对待检测页面的差异检测,进而获得差异检测结果。The embodiment of the present application provides a method for detecting page differences, and the method can be executed by a system for detecting page differences. The page difference detection system obtains the page to be detected, the standard page and the target detection mode determined by the user through a user interface such as a graphical user interface (GUI) or a command user interface (CUI), etc., and then extracts the page to be detected. and the page structure information and/or page element semantic information in the standard page, based on the target detection mode and the page structure information and/or page element semantic information in the page to be detected and the standard page, the difference detection of the page to be detected is realized, and then Get the difference detection result.

该方法中,用户可以自主选择差异检测模式,有效满足用户对页面差异检测的多样化需求,并且,基于待检测页面和标准页面中的页面结构信息和/或页面元素语义信息来对待检测页面进行差异检测,无需依赖后台代码信息,有效提升页面差异检测的准确度,且有效扩大页面差异检测的粒度范围。In this method, the user can independently select the difference detection mode, which effectively meets the user's diverse needs for page difference detection, and the page to be detected is based on the page structure information and/or page element semantic information in the page to be detected and the standard page. Difference detection does not need to rely on background code information, effectively improves the accuracy of page difference detection, and effectively expands the granularity of page difference detection.

请参见图1,图1示出了本申请实施例适用的系统架构示意图,在图1中,页面差异检测系统100可以和用户进行交互,以实现页面差异检测功能。Referring to FIG. 1 , FIG. 1 shows a schematic diagram of a system architecture to which the embodiments of the present application are applied. In FIG. 1 , the page difference detection system 100 may interact with a user to implement a page difference detection function.

需要说明的是,页面差异检测系统100可以以应用程序接口的形式提供给用户使用,也可以以网页界面的形式提供给用户使用。It should be noted that, the page difference detection system 100 may be provided to the user in the form of an application program interface, and may also be provided to the user in the form of a web interface.

如图1所示,页面差异检测系统100包括接口单元101、处理单元102。As shown in FIG. 1 , the page difference detection system 100 includes an interface unit 101 and a processing unit 102 .

接口单元101,用于和用户进行交互。The interface unit 101 is used to interact with the user.

在一种可能的实施例中,当页面差异检测系统100以应用程序接口的形式提供给用户使用时,接口单元101可以是命令用户界面,页面差异检测系统100通过该命令用户界面可以接收用户输入的调用命令(例如,接收包含目标检测模式参数信息的程序代码)。In a possible embodiment, when the page difference detection system 100 is provided to the user in the form of an application program interface, the interface unit 101 may be a command user interface, and the page difference detection system 100 may receive user input through the command user interface (for example, receive program code containing object detection mode parameter information).

在另一种可能的实施例中,当页面差异检测系统100以网页界面的形式提供给用户使用时,接口单元101可以是图形用户界面,页面差异检测系统100通过图形用户界面接收可以用户执行的操作(例如,上传图片的操作、选择目标检测模式的操作)。In another possible embodiment, when the page difference detection system 100 is provided to the user in the form of a web interface, the interface unit 101 may be a graphical user interface, and the page difference detection system 100 receives the user-executed information through the graphical user interface. Actions (for example, the action of uploading a picture, the action of selecting the object detection mode).

处理单元102,可以用于获取待检测页面和标准页面,对待检测页面和标准页面进行处理,获得待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及标准页面的第二页面结构信息和/或第二页面元素语义信息。The processing unit 102 can be used to obtain the page to be detected and the standard page, process the page to be detected and the standard page, and obtain the first page structure information and/or the semantic information of the first page element of the page to be detected, and the second page of the standard page. Page structure information and/or second page element semantic information.

进一步,处理单元102,还可以用于根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、以及第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测,获得第一差异检测结果。Further, the processing unit 102 can also be configured to perform the processing on the page to be detected according to the target detection mode, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information Difference detection is performed to obtain a first difference detection result.

应理解,待检测页面可以是待测软件产品(例如网页、应用程序(application,App) 等)在不同环境下的图形用户界面(graphical user interface,GUI)截图,即待检测页面可以是一个或多个GUI截图,本申请实施例不作具体的限定。其中,环境可以理解为操作系统、硬件设备、或网页浏览器以及对应网页浏览器的版本中的一种或多种所组合的环境。标准页面为待测软件产品的标准GUI截图,具体可以是预先设计的GUI截图,也可以是在用户指定环境(例如,视窗操作(windows)系统的谷歌浏览器)下该待测软件产品所显示的GUI截图。It should be understood that the page to be detected can be a screenshot of a graphical user interface (GUI) of a software product to be tested (eg, a web page, an application (application, App), etc.) in different environments, that is, the page to be detected can be one or more Multiple GUI screenshots are not specifically limited in this embodiment of the present application. Wherein, the environment may be understood as an environment combined with one or more of an operating system, a hardware device, or a web browser and a version of the corresponding web browser. The standard page is the standard GUI screenshot of the software product to be tested, which can be a pre-designed GUI screenshot, or can be displayed by the software product to be tested under the user-specified environment (for example, Google Chrome of a Windows operating system). screenshot of the GUI.

其中,处理单元102可以包括获取模块1021、训练模块1022、特征提取模块1023,差异检测模块1024、数据库1025。The processing unit 102 may include an acquisition module 1021 , a training module 1022 , a feature extraction module 1023 , a difference detection module 1024 , and a database 1025 .

获取模块1021,可以用于获取待检测页面和标准页面,以及获取用户确定的目标检测模式。The obtaining module 1021 can be used to obtain the page to be detected and the standard page, and obtain the target detection mode determined by the user.

在一种可能的实施例中,在接口单元101接收到用户操作或者调用命令时,获取模块 1021可以根据用户操作或者调用命令,确定用户选择的目标检测模式。In a possible embodiment, when the interface unit 101 receives a user operation or a calling command, the acquiring module 1021 may determine the target detection mode selected by the user according to the user operation or calling command.

在一种可能的实施例中,在接口单元101接收到用户输入的待测网页的统一资源定位符(uniform resource location,URL)(也称作网页链接)和/或URL所对应的网页页面中的超链接时,获取模块1021可以用于基于该网页链接,生成该待测网页对应的待检测页面和标准页面,并将待检测页面和标准页面保存在数据库1025。In a possible embodiment, the interface unit 101 receives a uniform resource locator (uniform resource location, URL) (also referred to as a web page link) and/or a web page corresponding to the URL of the web page to be tested input by the user. When there is a hyperlink, the obtaining module 1021 may be configured to generate the to-be-detected page and the standard page corresponding to the to-be-tested webpage based on the webpage link, and save the to-be-detected page and the standard page in the database 1025 .

在另一种可能的实施例中,接口单元101接收到用户上传的至少两张图片时,获取模块1021可以将用户上传的至少两张图片分别标记为待检测页面和标准页面。In another possible embodiment, when the interface unit 101 receives the at least two pictures uploaded by the user, the acquiring module 1021 may mark the at least two pictures uploaded by the user as a page to be detected and a standard page respectively.

训练模块1022,可以用于基于数据库1025存储的海量网页截图,或者,海量网页在不同环境下的GUI截图进行训练,得到深度学习模型;其中,该深度学习模型的输入为海量网页截图中的任一GUI截图,输出为该任一GUI截图中的页面结构信息和/或页面元素语义信息。The training module 1022 can be used to perform training based on the screenshots of the massive webpages stored in the database 1025, or the screenshots of the GUI of the massive webpages in different environments, to obtain a deep learning model; wherein, the input of the deep learning model is any of the screenshots of the massive webpages. A GUI screenshot, the output is page structure information and/or page element semantic information in any GUI screenshot.

特征提取模块1023,可以用于将待检测页面输入该深度学习模型,并基于该深度学习模型输出待检测页面的第一页面结构信息和/或第一页面元素语义信息;以及,将标准页面输入深度学习模型,基于深度学习模型输出标准页面的第二页面结构信息和/或第二页面元素语义信息。The feature extraction module 1023 can be used to input the page to be detected into the deep learning model, and output the first page structure information and/or the semantic information of the first page element of the page to be detected based on the deep learning model; and, input the standard page The deep learning model outputs the second page structure information and/or the second page element semantic information of the standard page based on the deep learning model.

差异检测模块1024,可以用于根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、以及第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测,获得第一差异检测结果。The difference detection module 1024 can be configured to perform difference detection on the page to be detected according to the target detection mode, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information , to obtain the first difference detection result.

需要说明的是,上述目标检测模式可以是:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式中的任一种,这里不作具体的限定。因此,差异检测模块1024在用于根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、第二页面结构信息和/或第二页面元素语义信息,实现对待检测页面的差异检测时有不同的实现方式。It should be noted that the above target detection mode may be any one of pixel comparison mode, page element semantic comparison mode, page layout comparison mode, and custom comparison mode, which is not specifically limited here. Therefore, the difference detection module 1024 is configured to realize the difference between the pages to be detected according to the target detection mode, the first page structure information and/or the first page element semantic information, the second page structure information and/or the second page element semantic information There are different implementations for detection.

在一种可能的实施例中,在获取模块1021确定用户选择的目标检测模式包括像素比对模式时,差异检测模块1024可以通过统计待检测页面和标准页面中每一个相同位置上像素差异,来确定待检测页面与标准页面的差异。In a possible embodiment, when the acquisition module 1021 determines that the target detection mode selected by the user includes the pixel comparison mode, the difference detection module 1024 can calculate the pixel difference at the same position between the page to be detected and the standard page to detect Determine the difference between the page to be inspected and the standard page.

在一种可能的实施例中,在获取模块1021确定用户选择的目标检测模式包括页面元素语义比对模式时,差异检测模块1024可以通过比较待检测页面的第一页面元素语义信息和标准页面的第二页面元素语义信息,来确定待检测页面与标准页面的差异。In a possible embodiment, when the acquisition module 1021 determines that the target detection mode selected by the user includes the page element semantic comparison mode, the difference detection module 1024 can compare the semantic information of the first page element of the page to be detected with the semantic information of the standard page The second page element semantic information is used to determine the difference between the to-be-detected page and the standard page.

在一种可能的实施例中,在获取模块1021确定用户选择的目标检测模式包括页面布局比对模式时,差异检测模块1024可以通过比较第一页面结构信息和第二页面结构信息,确定待检测页面与标准页面的差异。In a possible embodiment, when the acquisition module 1021 determines that the target detection mode selected by the user includes the page layout comparison mode, the difference detection module 1024 may compare the first page structure information and the second page structure information to determine the target detection mode to be detected. Differences between pages and standard pages.

其中,第一页面结构信息包括待检测页面中的页面元素的样式、位置或类型中的至少一个,第二页面结构信息包括标准页面中的页面元素的样式、位置或类型中的至少一个;差异检测模块1024通过比较第一页面结构信息和第二页面结构信息,确定第一差异检测结果的具体实施方式有多种,包括但不限于以下三种:Wherein, the first page structure information includes at least one of styles, positions or types of page elements in the page to be detected, and the second page structure information includes at least one of styles, positions or types of page elements in standard pages; differences; The detection module 1024 compares the first page structure information and the second page structure information to determine the specific implementation manner of the first difference detection result, including but not limited to the following three:

方式1,统计待检测页面中第一页面元素与标准页面中至少一个样式、类型均相同的第一页面元素与第二页面元素的位置差异程度。Manner 1: Count the degree of positional difference between the first page element in the page to be detected and the first page element and the second page element that have the same style and type in at least one of the standard pages.

方式2,统计待检测页面与标准页面中至少一个位置、类型均相同的第一页面元素与第二页面元素的样式差异程度。Method 2: Count the degree of style difference between the first page element and the second page element that have at least one location and type in the page to be detected and the standard page.

方式3,统计待检测页面与标准页面中至少一个位置、样式均相同的第一页面元素与第二页面元素的类型差异程度。Manner 3: Count the degree of difference between the types of the first page element and the second page element that have the same position and style in at least one of the page to be detected and the standard page.

应理解,第一页面元素可以是待检测页面中的任一页面元素,第二页面元素为该任一页面元素在标准页面中对应的页面元素。方式1和方式2中的第一页面元素和第二页面元素的位置相同可以是完全相同也可以是部分相同(例如,80%的位置相同),本申请实施例不作具体的限定。It should be understood that the first page element may be any page element in the page to be detected, and the second page element is the page element corresponding to the any page element in the standard page. The positions of the first page element and the second page element in Modes 1 and 2 may be identical or partially the same (for example, 80% of the positions are the same), which is not specifically limited in this embodiment of the present application.

在本申请实施例中,页面差异检测系统100的各个部分可以集中地部署在本地计算设备(处于用于用户直接控制之下的用户设备,如笔记本电脑、台式机、智能手机等用户终端)或者云计算集群(包括至少一个云计算设备,例如:云服务器等)中。当然,页面差异检测系统100的各个部分也可以分布式地部署在云计算集群中。In this embodiment of the present application, each part of the page difference detection system 100 may be centrally deployed on a local computing device (a user device under the direct control of a user, such as a user terminal such as a notebook computer, a desktop computer, a smart phone, etc.) or In a cloud computing cluster (including at least one cloud computing device, such as a cloud server, etc.). Of course, various parts of the page difference detection system 100 can also be deployed in a cloud computing cluster in a distributed manner.

下面以待测软件产品为网页为例,结合具体的附图介绍页面差异检测系统100以不同的产品形态提供给用户使用时,页面差异检测系统100与用户进行交互的详细过程。Taking the software product to be tested as a webpage as an example, the detailed process of the interaction between the page difference detection system 100 and the user when the page difference detection system 100 is provided to the user in different product forms is described with reference to the specific drawings.

需要说明的是,当页面差异检测系统100以网页界面的形式提供给用户使用时,页面差异检测系统100为用户提供了图形用户界面,用户可以在这个图形用户界面中输入信息 (例如,图片、URL等),然后页面差异检测系统100可以基于通过这个图形用户界面接收的信息进行页面差异检测。另外,在页面差异检测系统100提供的这个图形用户界面中,还可以在页面差异检测系统100不同的检测阶段(检测前、检测后)显示不同的用户界面 (如图2所示的页面差异检测界面、图5所示的网页页面设置界面、图5所示的网页页面设置界面)。如此,可以使得页面差异检测系统100在进行页面差异检测的过程中与用户进行良好的交互。It should be noted that when the page difference detection system 100 is provided to the user in the form of a web interface, the page difference detection system 100 provides the user with a graphical user interface, in which the user can input information (for example, pictures, URL, etc.), the page difference detection system 100 can then perform page difference detection based on the information received through this graphical user interface. In addition, in this graphical user interface provided by the page difference detection system 100, different user interfaces can also be displayed in different detection stages (before and after detection) of the page difference detection system 100 (the page difference detection shown in FIG. 2 ). interface, the web page setting interface shown in Figure 5, the web page setting interface shown in Figure 5). In this way, the page difference detection system 100 can have good interaction with the user in the process of page difference detection.

相应的,页面差异检测系统100以应用程序接口的形式提供给用户使用时,页面差异检测系统100可以通过命令用户界面与用户进行交互。应理解,这里的命令用户界面具体可以是用户使用集成开发环境(integrated development environment,IDE)(例如,IPython、 Anaconda等)的界面;或者,第三方接口调用工具(例如,Swagger Codegen)的用户界面。Correspondingly, when the page difference detection system 100 is provided to the user in the form of an application program interface, the page difference detection system 100 can interact with the user through a command user interface. It should be understood that the command user interface here may specifically be an interface for a user to use an integrated development environment (IDE) (for example, IPython, Anaconda, etc.); or a user interface for a third-party interface calling tool (for example, Swagger Codegen) .

图3A中,示例性的绘制出了IDE的界面,用户可以通过外部输入输出装置(如显示器、键盘以及鼠标等装置),在IDE中进行操作,例如可以编写上传GUI截图和标准GUI截图至页面差异检测系统100的程序代码、以及包含待测网页的URL和/或超链接至页面差异检测系统100的程序代码。In FIG. 3A, the interface of the IDE is exemplarily drawn, and the user can operate in the IDE through external input and output devices (such as a display, a keyboard, a mouse, etc.), for example, can write and upload GUI screenshots and standard GUI screenshots to the page The program code of the difference detection system 100, and the program code containing the URL and/or hyperlink of the web page to be tested to the page difference detection system 100.

图3B中,示例性的绘制出了第三方接口调用工具在显示器中的界面,该界面中提供了可以与用户进行交互的图形用户界面,用户可以通过外部输入输出装置(如显示器、键盘以及鼠标等装置),在第三方接口调用工具提供的图形用户界面中输入待测网页的URL或者目标检测模式的相关参数信息,第三方接口调用工具可以基于该待测网页的URL、目标检测模式的相关的参数信息(例如,语义比对模式标识及语义差异程度阈值),对待测网页对应的GUI截图进行差异检测,并通过该图形用户界面向用户返回差异检测结果。In FIG. 3B, the interface of the third-party interface calling tool on the display is exemplarily drawn, and the interface provides a graphical user interface that can interact with the user. The user can use external input and output devices (such as a display, a keyboard and a mouse etc. device), input the URL of the webpage to be tested or the relevant parameter information of the target detection mode in the graphical user interface provided by the third-party interface calling tool, the third-party interface calling tool can be based on the URL of the webpage to be tested, the relevant parameter information of the target detection mode The parameter information (for example, the semantic comparison mode identifier and the semantic difference degree threshold) is detected, the difference detection is performed on the GUI screenshot corresponding to the web page to be tested, and the difference detection result is returned to the user through the graphical user interface.

例如,用户在图3B所示的第三方接口调用工具提供的图形用户界面中输入了“https://aims-wct.huawei.com/v1/comparison/strict”、以及目标检测模式的相关参数,第三方接口调用工具可以调用页面差异检测系统100,以实现对该“https://aims-wct.huawei.com/v1/comparison/strict”对应的GUI截图进行差异检测,并在图 3B所示的图形用户界面中显示相应的页差异检测结果。For example, the user inputs "https://aims-wct.huawei.com/v1/comparison/strict" and related parameters of the target detection mode in the graphical user interface provided by the third-party interface calling tool shown in FIG. 3B, The third-party interface calling tool can call the page difference detection system 100 to implement difference detection for the GUI screenshot corresponding to "https://aims-wct.huawei.com/v1/comparison/strict", which is shown in FIG. 3B . The corresponding page difference detection results are displayed in the GUI of the .

本申请实施例并不限定IDE的部署方式,例如IDE可以为部署在云端的应用程序,为云端IDE,也即该IDE可以部署在边缘计算设备系统或云计算系统中,用户可以通过本地设备上的外部输入输出装置实现在该云端IDE的操作。IDE也可以是安装在本地的终端计算设备上的客户端IDE,也就是说,该IDE直接运行在本地计算设备上。This embodiment of the present application does not limit the deployment method of the IDE. For example, the IDE may be an application deployed in the cloud, and it may be a cloud IDE, that is, the IDE may be deployed in an edge computing device system or a cloud computing system. The external input and output device realizes the operation in this cloud IDE. The IDE may also be a client IDE installed on a local terminal computing device, that is, the IDE runs directly on the local computing device.

请参见图4,图4示出了本申请实施例提供的一种页面差异检测方法的流程示意图,该方法可以应用于页面差异检测系统100,该方法包括:Please refer to FIG. 4. FIG. 4 shows a schematic flowchart of a page difference detection method provided by an embodiment of the present application. The method can be applied to the page difference detection system 100, and the method includes:

S401、页面差异检测系统100获取待检测页面和标准页面。S401. The page difference detection system 100 acquires the page to be detected and the standard page.

应理解,待检测页面可以是待测网页的一个或多个GUI截图(也称作待测GUI截图),标准页面可以是为待测网页的标准页面的GUI截图(也称作标准GUI截图),具体可以是预先设计的GUI截图,也可以是该待测网页在用户指定环境(例如,视窗操作(windows) 系统的谷歌浏览器)下所显示的GUI截图。It should be understood that the page to be tested may be one or more GUI screenshots of the webpage to be tested (also referred to as GUI screenshots to be tested), and the standard page may be a GUI screenshot of a standard page of the webpage to be tested (also referred to as standard GUI screenshots) , which may be a pre-designed GUI screenshot, or a GUI screenshot displayed by the web page to be tested under a user-specified environment (eg, Google Chrome of a Windows operating system).

在一种可能的设计中,页面差异检测系统100以网页界面形式提供给用户使用,页面差异检测系统100获取待测GUI截图和标准GUI截图的具体实施方式,包括但不限于以下两种:In a possible design, the page difference detection system 100 is provided to the user in the form of a web interface, and the specific implementation manners that the page difference detection system 100 obtains the GUI screenshots to be tested and the standard GUI screenshots include but are not limited to the following two:

方式1,页面差异检测系统100,可以通过图形用户界面(例如图2所示的页面差异检测界面)接收用户上传的待测网页的待测GUI截图和标准GUI截图。Manner 1, the page difference detection system 100 can receive the to-be-tested GUI screenshots and standard GUI screenshots of the to-be-tested webpage uploaded by the user through a graphical user interface (eg, the page difference detection interface shown in FIG. 2 ).

方式2,页面差异检测系统100可以通过图形用户界面(例如图2所示的页面差异检测界面)接收用户输入的待测网页的URL和/或待测网页的URL所对应的网页页面中的超链接,进而页面差异检测系统100可以基于该URL和/或超链接,生成待测网页的待测GUI 截图和标准GUI截图。Mode 2, the page difference detection system 100 may receive the URL of the web page to be tested input by the user and/or the URL of the web page to be tested corresponding to the URL of the web page to be tested through a graphical user interface (for example, the page difference detection interface shown in FIG. 2). link, and then the page difference detection system 100 can generate a screenshot of the GUI to be tested and a screenshot of the standard GUI of the webpage to be tested based on the URL and/or the hyperlink.

其中,超链接具体可以是该网页链接对应的网页页面中特定页面元素的定位信息。示例性的,假设待测网页的URL为百度的网址,该超链接可以是百度网址所显示的页面中的“百度学术”对应的链接信息。The hyperlink may specifically be positioning information of a specific page element in the web page corresponding to the web page link. Exemplarily, assuming that the URL of the webpage to be tested is the website of Baidu, the hyperlink may be link information corresponding to "Baidu Academic" in the page displayed by the website of Baidu.

需要说明的是,在页面差异检测系统100基于待测网页的URL和/或超链接,生成待测网页的待测GUI截图和标准GUI截图之前,用户可以对待测网页的环境信息、页面信息进行设置。It should be noted that, before the page difference detection system 100 generates a screenshot of the GUI to be tested and a screenshot of a standard GUI of the web page to be tested based on the URL and/or hyperlink of the web page to be tested, the user can check the environment information and page information of the web page to be tested. set up.

页面差异检测系统100在如图5(a)所示的页面差异检测界面中检测到用户输入待测网页的URL(例如,“https://baidu.com”)后,可以控制页面差异检测界面跳转至如图5(b) 所示的网页页面设置界面。页面差异检测系统100可以通过该网页页面设置界面中接收用户对待测网页的环境设置信息、页面设置信息。The page difference detection system 100 can control the page difference detection interface after detecting that the user inputs the URL of the web page to be tested (for example, "https://baidu.com") in the page difference detection interface shown in FIG. 5(a). Jump to the web page setting interface as shown in Figure 5(b). The page difference detection system 100 can receive the user's environment setting information and page setting information of the webpage to be tested through the webpage setting interface.

具体的,在图5(b)中,在页面差异检测系统100通过网页页面设置界面提供的环境设置功能中,用户可以进行操作系统的设置、浏览器以及浏览器版本的设置、截图应用的设置。Specifically, in FIG. 5(b), in the environment setting function provided by the page difference detection system 100 through the web page setting interface, the user can set the operating system, the setting of the browser and the browser version, and the setting of the screenshot application. .

示例性的,操作系统可以设置为windows、linux、macos、安卓(android)等的任一种;截图应用可以设置成浏览器或者操作系统自带的截图应用;浏览器设置可以设置为谷歌、火狐(firefox)等浏览器类型,另外还可以设置这些浏览器的版本信息(例如,最新版本、历史版本)。可选的,在页面差异检测系统100通过网页页面设置界面提供的环境设置功能中,在环境设置功能中,用户还可以设置网络代理信息。Exemplarily, the operating system can be set to any one of windows, linux, macos, android (android), etc.; the screenshot application can be set to a browser or a screenshot application that comes with the operating system; the browser setting can be set to Google, Firefox (firefox) and other browser types, and you can also set the version information of these browsers (for example, the latest version, the historical version). Optionally, in the environment setting function provided by the page difference detection system 100 through the webpage page setting interface, in the environment setting function, the user may also set network proxy information.

具体的,在图5(b)中,在页面差异检测系统100提供的网页页面设置界面中,用户可以设置待测页面和标准页面的分辨率(即页面的宽和高)、以及是否显示通知提醒等。Specifically, in FIG. 5(b), in the webpage page setting interface provided by the page difference detection system 100, the user can set the resolution of the page to be tested and the standard page (ie the width and height of the page), and whether to display a notification reminder etc.

为了提高页面差异检测的效率,如图5(b)所示的网页页面设置界面中还提供了默认设置选项,页面差异检测系统100检测到针对默认设置选择的点击操作之后,可以自动为待测网页配置环境设置信息、页面设置信息等,无需用户手动输入。如此,有效提升用户体验。In order to improve the efficiency of page difference detection, the web page setting interface shown in FIG. 5(b) also provides a default setting option. After the page difference detection system 100 detects the click operation selected for the default setting, it can The webpage configuration environment setting information, page setting information, etc., do not require manual input by the user. In this way, the user experience is effectively improved.

可选的,页面差异检测系统100可以将用户每次使用的环境设置信息、页面设置信息记录下来,生成默认设置中的历史设置信息,用户下一次使用页面差异检测系统100时,在网页页面设置界面中选择默认设置选项之后,页面差异检测系统100可以显示如图6所示的默认设置界面,在该默认设置界面中显示原始设置、历史设置1、历史设置2等可选项。Optionally, the page difference detection system 100 may record the environment setting information and page setting information used by the user each time, and generate historical setting information in the default settings. After the default setting option is selected in the interface, the page difference detection system 100 can display the default setting interface as shown in FIG.

进一步的,页面差异检测系统100检测到针对原始设置、历史设置1、历史设置2中任一项的点击操作之后,还可以接收用户输入的信息,基于该信息更新该任一项中的特定参数信息(环境信息、页面设置信息)。例如,页面差异检测系统100确定用户选择历史设置2之后,还可以接收用户输入的环境信息对历史设置2中的环境设置信息进行更新。如此,可以有效提升页面差异检测的效率。Further, after the page difference detection system 100 detects a click operation on any one of the original setting, the historical setting 1, and the historical setting 2, it can also receive the information input by the user, and update the specific parameter in the any one based on the information. Information (environment information, page setup information). For example, after determining that the user selects the historical setting 2, the page difference detection system 100 may also receive the environmental information input by the user to update the environmental setting information in the historical setting 2. In this way, the efficiency of page difference detection can be effectively improved.

在另一种可能的设计中,页面差异检测系统100以应用程序接口形式提供给用户使用,页面差异检测系统100获取待测GUI截图和标准GUI截图的具体实施方式,包括但不限于以下两种:In another possible design, the page difference detection system 100 is provided to the user in the form of an application program interface, and the specific implementations for the page difference detection system 100 to obtain the GUI screenshots to be tested and the standard GUI screenshots include but are not limited to the following two :

方式1,页面差异检测系统100可以通过命令用户界面(如图3A所示的IDE界面)接收用户输入的包含待测GUI截图和标准GUI截图的存储地址的程序代码,基于该程序代码获取待测网页的待测GUI截图和标准GUI截图。Mode 1, the page difference detection system 100 can receive the program code input by the user including the storage addresses of the GUI screenshots to be tested and the standard GUI screenshots through the command user interface (the IDE interface shown in FIG. 3A ), and obtain the program codes to be tested based on the program code. Screenshots of the GUI to be tested and standard GUI screenshots of the webpage.

方式2,页面差异检测系统100可以通过命令用户界面接收用户输入的包含待测网页的 URL和/或该URL所对应的网页页面中的超链接、以及和环境设置信息、页面设置信息的程序代码,并从该程序代码中解析出待该URL和/或该超链接、环境设置信息、页面设置信息,基于该URL和/或该超链接,生成待测网页在该环境设置信息、页面设置信息对应的待测GUI截图和标准GUI截图。Mode 2, the page difference detection system 100 can receive the URL of the web page to be tested and/or the hyperlink in the web page corresponding to the URL, and the program code of the environment setting information and the page setting information input by the user through the command user interface , and parse out this URL and/or this hyperlink, environment setting information, page setting information from this program code, based on this URL and/or this hyperlink, generate the environment setting information, page setting information of the webpage to be tested in this environment setting information Corresponding GUI screenshots to be tested and standard GUI screenshots.

可选的,页面差异检测系统100在生成待测网页的待测GUI截图和标准GUI截图之后,页面差异检测系统100可以以某种编码方式(例如,以字符串的形式)将待测GUI截图和标准GUI截图保存在页面差异检测系统100中的数据存储模块。Optionally, after the page difference detection system 100 generates the GUI screenshot to be tested and the standard GUI screenshot of the webpage to be tested, the page difference detection system 100 can use a certain encoding method (for example, in the form of a string) to screenshot the GUI to be tested. and standard GUI screenshots are stored in the data storage module of the page difference detection system 100 .

S402、页面差异检测系统100对待检测页面和标准页面进行处理,获得待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及标准页面的第二页面结构信息和/或第二页面元素语义信息。S402. The page difference detection system 100 processes the page to be detected and the standard page, and obtains first page structure information and/or first page element semantic information of the page to be detected, and second page structure information and/or second page structure information of the standard page Page element semantic information.

在一种可能的实施例中,页面差异检测系统100可以使用深度学习模型对待检测页面和标准页面进行特征提取,获得待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及标准页面的第二页面结构信息和/或第二页面元素语义信息。In a possible embodiment, the page difference detection system 100 may use a deep learning model to perform feature extraction on the page to be detected and the standard page, obtain first page structure information and/or first page element semantic information of the page to be detected, and The second page structure information and/or the second page element semantic information of the standard page.

相应的,页面差异检测系统100在对待检测页面和标准页面进行处理之前,需要先获得该深度学习模型。Correspondingly, before processing the page to be detected and the standard page, the page difference detection system 100 needs to obtain the deep learning model first.

以下介绍深度学习模型的获得方式。The following describes how to obtain the deep learning model.

具体的,请参见图7,在图7中页面差异检测系统100通过对海量网页GUI截图进行训练,可以得到深度学习模型;该深度学习模型的输入可以是任一网页GUI截图,输出是该任一网页GUI截图中的页面结构信息和/或页面元素语义信息。其中,页面结构信息包括页面元素的位置、类型、样式等信息。Specifically, please refer to FIG. 7. In FIG. 7, the page difference detection system 100 can obtain a deep learning model by training a large number of webpage GUI screenshots; the input of the deep learning model can be any webpage GUI screenshot, and the output is the arbitrary webpage GUI screenshot. Page structure information and/or page element semantic information in a webpage GUI screenshot. The page structure information includes information such as the position, type, and style of page elements.

在页面差异检测系统100获得深度学习模型之后,就可以基于该深度学习模型对待测网页的待检测页面和标准页面进行特征提取。如图8所示,页面差异检测系统100将待检测页面输入该深度学习模型,可以得到待检测页面的第一页面结构信息和/或第一页面元素语义信息;页面差异检测系统100将标准页面输入该深度学习模型,可以得到标准页面的第二页面结构信息和/或第二页面元素语义信息。After the page difference detection system 100 obtains the deep learning model, feature extraction can be performed on the to-be-detected page and the standard page of the to-be-tested web page based on the deep learning model. As shown in FIG. 8 , the page difference detection system 100 inputs the page to be detected into the deep learning model, and can obtain the first page structure information and/or the first page element semantic information of the page to be detected; By inputting the deep learning model, the second page structure information and/or the second page element semantic information of the standard page can be obtained.

应理解,当待检测页面是一个待测GUI截图时,第一页面结构信息和/或第一页面元素语义信息为一个待测GUI截图的页面结构信息和/或页面元素语义信息;当待检测页面是多个待测GUI截图时,第一页面结构信息和/或第一页面元素语义信息为多个待测GUI截图的页面结构信息和/或页面元素语义信息的集合。It should be understood that when the page to be detected is a screenshot of the GUI to be tested, the first page structure information and/or the semantic information of the first page element is the page structure information and/or the semantic information of the page element of a screenshot of the GUI to be tested; When the page is a plurality of GUI screenshots to be tested, the first page structure information and/or the first page element semantic information is a collection of page structure information and/or page element semantic information of the multiple GUI screenshots to be tested.

S403、页面差异检测系统100获取用户确定的目标检测模式。S403. The page difference detection system 100 acquires the target detection mode determined by the user.

在一种可能的设计中,页面差异检测系统100以网页界面形式提供给用户使用,页面差异检测系统100可以显示如图9所示的选择对比模式界面,该选择对比模式界面中示出了像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式;页面差异检测系统100检测到针对该选择对比模式界面中任一比对模式的点击操作后,将该任一比对模式确定为目标检测模式。In a possible design, the page difference detection system 100 is provided to the user in the form of a web interface, and the page difference detection system 100 can display a selection and comparison mode interface as shown in FIG. Comparison mode, page element semantic comparison mode, page layout comparison mode, and custom comparison mode; after the page difference detection system 100 detects a click operation for any comparison mode in the selection comparison mode interface, An alignment mode is determined as a target detection mode.

在另一种可能的设计中,页面差异检测系统100以应用程序接口形式提供给用户使用,页面差异检测系统100可以通过命令用户界面(如图3A所示的IDE界面)接收用户输入的包含目标检测模式的相关参数的程序代码;基于该程序代码,确定目标检测模式。In another possible design, the page difference detection system 100 is provided to the user in the form of an application program interface, and the page difference detection system 100 can receive the inclusion target input by the user through a command user interface (the IDE interface shown in FIG. 3A ). The program code of the relevant parameters of the detection mode; based on the program code, the target detection mode is determined.

其中相关参数具体可以是该目标检测模式对应的差异类型、差异程度。例如,目标检测模式为像素比对模式时,该相关参数为像素比对模式的标识、像素差异比例为80%;又例如,目标检测模式为页面布局比对模式时,相关参数为页面布局比对模式的标识、页面元素的位置偏移阈值;又例如,目标检测模式为页面元素语义比对模式时,相关参数为页面布局比对模式标识、页面元素语义的相似程度;再例如,目标检测模式为自定义比对模式时,相关参数为像素、页面元素语义、页面结构信息中的一种或多种。可选的,相关参数中还可以包括待检测页面的特定区域的位置信息和/或特定页面元素的标识信息。The relevant parameters may specifically be the difference type and difference degree corresponding to the target detection mode. For example, when the target detection mode is the pixel comparison mode, the relevant parameter is the identification of the pixel comparison mode, and the pixel difference ratio is 80%; for another example, when the target detection mode is the page layout comparison mode, the relevant parameter is the page layout ratio. The identification of the mode, the position offset threshold of the page elements; for another example, when the target detection mode is the page element semantic comparison mode, the relevant parameters are the page layout comparison mode identification and the similarity degree of the page element semantics; for another example, the target detection mode When the mode is a custom comparison mode, the relevant parameters are one or more of pixels, page element semantics, and page structure information. Optionally, the relevant parameters may further include location information of a specific area of the page to be detected and/or identification information of a specific page element.

S404、页面差异检测系统100根据目标检测模式、第一页面结构信息和/或第一页面元素语义信息、以及第二页面结构信息和/或第二页面元素语义信息,对待检测页面进行差异检测,获得第一差异检测结果。S404, the page difference detection system 100 performs difference detection on the page to be detected according to the target detection mode, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information, A first difference detection result is obtained.

需要说明的是,上述目标检测模式可以是:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式中的任一种。因此,目标检测模式不同,页面差异检测系统100对待检测页面进行差异检测的具体实现方式也不同。It should be noted that the above target detection mode may be any one of a pixel comparison mode, a page element semantic comparison mode, a page layout comparison mode, and a custom comparison mode. Therefore, depending on the target detection mode, the specific implementation manner of the page difference detection system 100 to perform the difference detection on the page to be detected is also different.

下面详细介绍不同比对模式下的差异检测过程。The difference detection process in different alignment modes is described in detail below.

(1)像素比对模式(1) Pixel comparison mode

在像素比对模式中,页面差异检测系统100可以提取待测GUI截图和标准GUI截图中每一个像素的像素值,依次比较待测GUI截图和标准GUI截图中每一个相同位置上的像素大小,进而统计检测GUI截图和标准GUI截图的像素差异程度,在像素差异程度满足预设条件时,可以认为待测GUI截图和标准GUI截图之间不存在像素差异。In the pixel comparison mode, the page difference detection system 100 can extract the pixel value of each pixel in the screenshot of the GUI to be tested and the screenshot of the standard GUI, and compare the pixel size of each pixel at the same position in the screenshot of the GUI to be tested and the screenshot of the standard GUI in turn, Further, the degree of pixel difference between the GUI screenshot and the standard GUI screenshot is statistically detected. When the pixel difference degree satisfies the preset condition, it can be considered that there is no pixel difference between the GUI screenshot to be tested and the standard GUI screenshot.

示例性的,预设条件为待测GUI截图和标准GUI截图中像素相同的比例大于预设比例 (如80%),页面差异检测系统100在对待检测GUI截图和标准GUI截图中每一个相同位置上的像素大小进行比较之后,发现检测GUI截图和标准GUI截图中90%的像素均相同,则认为待检测GUI截图和标准GUI截图不存在像素差异。Exemplarily, the preset condition is that the ratio of the same pixels in the screenshot of the GUI to be tested and the screenshot of the standard GUI is greater than the preset ratio (eg, 80%), and the page difference detection system 100 is at the same position in each screenshot of the GUI to be detected and the screenshot of the standard GUI. After comparing the pixel sizes on the screen, it is found that 90% of the pixels in the detected GUI screenshot and the standard GUI screenshot are the same, and it is considered that there is no pixel difference between the to-be-detected GUI screenshot and the standard GUI screenshot.

(2)页面元素语义比对模式(2) page element semantic comparison mode

在页面元素语义比对模式中,页面差异检测系统100可以提取待测GUI截图和标准GUI 截图中每一个页面元素的语义信息,依次统计待测GUI截图中至少一个第一页面元素与标准GUI截图中至少一个第二页面元素的语义差异程度,根据该语义差异程度确定第一差异检测结果。其中,至少一个第一页面元素中每个第一页面元素在待测GUI截图中的位置与至少一个第二页面元素中每个第二页面元素在标准GUI截图中的位置一一对应相同。第一页面元素或第二页面元素可以是文字、图片、超链接等等,本申请实施例不作具体的限定。In the page element semantic comparison mode, the page difference detection system 100 can extract the semantic information of each page element in the GUI screenshot to be tested and the standard GUI screenshot, and count at least one first page element in the GUI screenshot to be tested and the standard GUI screenshot in turn The semantic difference degree of at least one of the second page elements, and the first difference detection result is determined according to the semantic difference degree. The position of each first page element in the at least one first page element in the GUI screenshot to be tested is in a one-to-one correspondence with the position of each second page element in the at least one second page element in the standard GUI screenshot. The first page element or the second page element may be text, pictures, hyperlinks, etc., which are not specifically limited in this embodiment of the present application.

其中,页面差异检测系统100根据该语义差异程度确定第一差异检测结果,具体可以是判断该语义差异程度是否超出预设阈值,若超出预设阈值,则认为第一页面元素和第二页面元素存在页面元素语义差异;若未超出预设阈值,则认为第一页面元素和第二页面元素不存在页面元素语义差异。Wherein, the page difference detection system 100 determines the first difference detection result according to the semantic difference degree. Specifically, it can be determined whether the semantic difference degree exceeds a preset threshold. If it exceeds the preset threshold, it is considered that the first page element and the second page element are There are page element semantic differences; if the preset threshold is not exceeded, it is considered that there is no page element semantic difference between the first page element and the second page element.

例如,假设预设阈值为2%,第一页面元素是文字,该文字具体为“我爱中国”,与第一页面元素相对应的第二页面元素的文字为“我爱中华”,则第一页面元素与第二页面元素的页面元素语义差异程度为25%,已超出预设阈值,则认为第一页面元素和第二页面元素存在页面元素语义差异,即待测GUI截图和标准GUI截图中存在页面元素语义差异。For example, assuming that the preset threshold is 2%, the first page element is text, the text is "I love China", and the text of the second page element corresponding to the first page element is "I love China", then the first page element is "I love China". The page element semantic difference between the first page element and the second page element is 25%, which exceeds the preset threshold, then it is considered that there is a page element semantic difference between the first page element and the second page element, that is, the GUI screenshot to be tested and the standard GUI screenshot There are semantic differences in page elements.

又例如,假设预设阈值为2%,第一页面元素中有100个文字,第二页面元素中也存在 100个文字,但第二页面元素中与第一页面元素有1个文字存在差异,则第一页面元素与第二页面元素的页面元素语义差异程度为1%,未超出预设阈值,则认为第一页面元素和第二页面元素不存在页面元素语义差异,即待测GUI截图和标准GUI截图中不存在页面元素语义差异。For another example, assuming that the preset threshold is 2%, there are 100 characters in the first page element, and 100 characters in the second page element, but there is a difference between the second page element and the first page element by 1 character, Then the page element semantic difference between the first page element and the second page element is 1%, and if it does not exceed the preset threshold, it is considered that there is no page element semantic difference between the first page element and the second page element, that is, the GUI screenshot and Page element semantic differences do not exist in standard GUI screenshots.

可选的,页面差异检测系统100根据该语义差异程度确定第一差异检测结果,还可以是识别出第一页面元素的第一目标对象和第二页面元素中的第二目标对象,比较第一目标对象和第二目标对象是否一致,若一致,则认为第一页面元素和第二页面元素不存在页面元素语义差异;若不一致,则认为第一页面元素和第二页面元素存在页面元素语义差异;Optionally, the page difference detection system 100 determines the first difference detection result according to the semantic difference degree, and may also identify the first target object of the first page element and the second target object in the second page element, and compare the first target object of the first page element and the second target object of the second page element. Whether the target object and the second target object are consistent, if they are consistent, it is considered that there is no page element semantic difference between the first page element and the second page element; if they are inconsistent, it is considered that there is a page element semantic difference between the first page element and the second page element ;

又例如,假设第一页面元素和第二页面元素是图片,该第一页面元素中的第一目标对象为“猫”,第二页面元素中的第二目标对象为“狗”,则第一目标对象和第二目标对象不一致,则认为第一页面元素和第二页面元素存在页面元素语义差异,即待测GUI截图和标准GUI截图中存在页面元素语义差异。For another example, assuming that the first page element and the second page element are pictures, the first target object in the first page element is "cat", and the second target object in the second page element is "dog", then the first If the target object and the second target object are inconsistent, it is considered that there is a semantic difference between the first page element and the second page element, that is, there is a semantic difference between the GUI screenshot to be tested and the standard GUI screenshot.

(3)页面布局比对模式(3) Page layout comparison mode

在页面布局比对模式中,页面差异检测系统100可以提取待检测GUI截图和标准GUI 截图中页面结构信息,其中页面结构信息包括页面元素的类型、样式、位置等,本申请不做限制。In the page layout comparison mode, the page difference detection system 100 can extract the page structure information in the GUI screenshot to be detected and the standard GUI screenshot, wherein the page structure information includes the type, style, position, etc. of page elements, which is not limited in this application.

以下例举其中三种可能的比对方式:Here are three examples of possible alignments:

方式1,页面差异检测系统100统计待测GUI截图中的第一页面元素与标准GUI截图中的第二页面元素的位置差异程度(例如,整体偏移或部分偏移)。其中,第一页面元素和第二页面元素的样式、类型均相同。Manner 1, the page difference detection system 100 counts the position difference (eg, overall offset or partial offset) of the first page element in the GUI screenshot to be tested and the second page element in the standard GUI screenshot. The styles and types of the first page element and the second page element are the same.

示例1,请参见图10,如图10(a)所示的标准GUI截图中的页面元素A包括页面元素A1、A2、A3,在图10(b)所示的待测GUI截图1中的页面元素B与页面元素A的样式、类型均相同,页面元素B包括页面元素B1、B2、B3,页面差异检测系统100通过比对页面元素B在待测GUI截图1中的位置与页面元素A在标准GUI截图中的位置,发现页面元素B相对于页面元素A存在整体偏移,则确定待测GUI截图和标准GUI截图中存在页面元素位置差异。Example 1, please refer to Fig. 10. The page element A in the standard GUI screenshot shown in Fig. 10(a) includes page elements A1, A2, and A3. Page element B has the same style and type as page element A. Page element B includes page elements B1, B2, and B3. The page difference detection system 100 compares the position of page element B in the GUI screenshot 1 to be tested with page element A. In the position in the standard GUI screenshot, it is found that the page element B has an overall offset relative to the page element A, and it is determined that there is a difference in the position of the page element between the GUI screenshot to be tested and the standard GUI screenshot.

示例2,在图10(c)所示的待测GUI截图2中的页面元素C与图10(a)所示的标准 GUI截图中的页面元素A的样式、类型均相同,页面元素C包括页面元素C1、C2、C3,页面差异检测系统100通过比对页面元素C在待测GUI截图2中的位置与页面元素A在标准GUI截图中的位置,发现页面元素C相对于页面元素A存在部分元素(即图10(c)中的C3)偏移,则确定待测GUI截图和标准GUI截图中存在页面元素位置差异。Example 2, the page element C in the screenshot 2 of the GUI to be tested shown in FIG. 10(c) is of the same style and type as the page element A in the screenshot of the standard GUI shown in FIG. 10(a). The page element C includes Page elements C1, C2, C3, the page difference detection system 100 finds that the page element C exists relative to the page element A by comparing the position of the page element C in the GUI screenshot 2 to be tested with the position of the page element A in the standard GUI screenshot If some elements (ie, C3 in Fig. 10(c)) are offset, it is determined that there is a difference in the position of page elements between the screenshot of the GUI to be tested and the screenshot of the standard GUI.

方式2,页面差异检测系统100统计待测GUI截图中的第一页面元素与标准GUI截图中的第二页面元素的样式差异程度。其中,第一页面元素和第二页面元素的位置、类型均相同。应理解,这里第一页面元素和第二页面元素的位置相同可以是完全相同,也可以是部分相同(例如,80%的位置相同,具体取决于用户设置的阈值参数),本申请实施例不作具体的限定。其中,页面元素的样式包括页面元素的尺寸、颜色、形状中的一种或多种。Mode 2, the page difference detection system 100 counts the degree of style difference between the first page element in the GUI screenshot to be tested and the second page element in the standard GUI screenshot. The positions and types of the first page element and the second page element are the same. It should be understood that the positions of the first page element and the second page element may be the same or partially the same (for example, 80% of the positions are the same, depending on the threshold parameter set by the user), and the embodiments of the present application do not specific restrictions. The style of the page element includes one or more of the size, color, and shape of the page element.

示例1,请参见图11,图11(a)所示的标准GUI截图中的页面元素A与图11(b)所示的待测GUI截图1中的页面元素B位置、类型均相同,页面差异检测系统100通过比较页面元素A与页面元素B的样式信息,发现页面元素A与页面元素B存在形状差异,则确定待测GUI截图1与标准GUI截图存在样式差异。Example 1, please refer to Fig. 11. Page element A in the screenshot of the standard GUI shown in Fig. 11(a) is in the same position and type as page element B in the screenshot 1 of the GUI under test shown in Fig. 11(b). The difference detection system 100 compares the style information of page element A and page element B and finds that there is a difference in shape between page element A and page element B, and determines that there is a style difference between the GUI screenshot 1 to be tested and the standard GUI screenshot.

示例2,图11(c)所示的待测GUI截图2中的页面元素C与图11(a)所示的标准 GUI截图中的页面元素A的位置、类型均相同,页面差异检测系统100通过比较页面元素 A与页面元素C的样式信息,发现页面元素A与页面元素C存在尺寸差异,则确定待测 GUI截图2与标准GUI截图存在样式差异。Example 2, the position and type of page element C in the screenshot 2 of the GUI to be tested shown in FIG. 11(c) and the page element A in the screenshot of the standard GUI shown in FIG. 11(a) are the same, and the page difference detection system 100 By comparing the style information of page element A and page element C, it is found that there is a size difference between page element A and page element C, and it is determined that there is a style difference between the GUI screenshot 2 to be tested and the standard GUI screenshot.

示例3,页面差异检测系统100识别出第一页面元素的颜色信息为蓝色,第二页面元素的颜色信息为红色,则第一页面元素和第二页面元素存在颜色差异;进而页面差异检测系统110确定待测GUI截图和标准GUI截图中存在样式差异。Example 3, the page difference detection system 100 identifies that the color information of the first page element is blue, and the color information of the second page element is red, then there is a color difference between the first page element and the second page element; and then the page difference detection system 110 Determine that there is a style difference between the GUI screenshot to be tested and the standard GUI screenshot.

方式3,页面差异检测系统100统计待测GUI截图中的第一页面元素与标准GUI截图中的第二页面元素的类型差异程度。Mode 3, the page difference detection system 100 counts the degree of type difference between the first page element in the GUI screenshot to be tested and the second page element in the standard GUI screenshot.

具体的,页面差异检测系统100统计待测GUI截图与标准GUI截图中是否存在页面元素缺失、增加、删除等情况。Specifically, the page difference detection system 100 counts whether there are page elements missing, added, deleted, etc. in the screenshot of the GUI to be tested and the screenshot of the standard GUI.

示例1,请参见图12,图12(a)所示的标准GUI截图中存在的页面元素A,页面元素 A包括页面元素A1、A2;而图12(b)所示的待测GUI截图1中不存在与页面元素A对应的位置、样式均相同的页面元素,则页面差异检测系统100确定待测GUI截图1与标准GUI 截图存在页面元素类型差异。Example 1, please refer to Fig. 12, the page element A that exists in the standard GUI screenshot shown in Fig. 12(a), the page element A includes page elements A1 and A2; while the GUI screenshot 1 to be tested shown in Fig. 12(b) If there is no page element with the same position and style as page element A, the page difference detection system 100 determines that the GUI screenshot 1 to be tested and the standard GUI screenshot have a page element type difference.

示例2,请继续参见图12,图12(c)所示的待测GUI截图2中的页面元素C与页面元素A的位置、样式均相同,但待测GUI截图2中还存在页面元素B,则页面差异检测系统100确定待测GUI截图2与标准GUI截图存在页面元素类型差异。Example 2, please continue to refer to Figure 12, the position and style of page element C and page element A in screenshot 2 of the GUI to be tested shown in Figure 12(c) are the same, but there is still page element B in screenshot 2 of the GUI to be tested , the page difference detection system 100 determines that there is a page element type difference between the GUI screenshot 2 to be tested and the standard GUI screenshot.

示例3,请继续参见图12,图12(d)所示的待测GUI截图3中的页面元素D与页面元素A的位置、样式均相同,但页面元素D中只有部分页面元素D1,则认为待测GUI截图3中页面元素部分缺失,则页面差异检测系统100确定待测GUI截图3与标准GUI截图存在页面元素类型差异。Example 3, please continue to refer to Figure 12, the position and style of page element D in the screenshot 3 of the GUI to be tested shown in Figure 12(d) are the same as page element A, but only part of page element D1 in page element D, then It is considered that the page elements in the screenshot 3 of the GUI to be tested are partially missing, and the page difference detection system 100 determines that there is a difference in page element type between the screenshot 3 of the GUI to be tested and the standard GUI screenshot.

(4)自定义比对模式(4) Custom comparison mode

在自定义比对模式中,页面差异检测系统100可以通过图形用户界面获取用户关注的差异类型,并确定出待检测页面中该差异类型对应的第一信息,以及标准页面中该差异类型对应的第二信息;根据第一信息和第二信息,确定第一差异检测结果。其中,用户关注的差异类型可以包括像素、页面元素语义、页面结构中的一种或多种。In the custom comparison mode, the page difference detection system 100 can obtain the difference type concerned by the user through the graphical user interface, and determine the first information corresponding to the difference type in the page to be detected, and the corresponding difference type in the standard page. second information; determining a first difference detection result according to the first information and the second information. The difference types concerned by the user may include one or more of pixels, page element semantics, and page structure.

请参见图13,图13示出了差异类型选择界面,在图13所示的差异类型选择界面中,用户可以选择其关注的差异类型,例如像素、页面元素语义、页面结构等,页面差异检测系统100检测到用户将光标放置在页面结构上时,还可以进一步显示页面结构下的页面元素样式、页面元素的位置、页面元素的类型、以供用户自主选择关注的差异类型。Please refer to Fig. 13. Fig. 13 shows the difference type selection interface. In the difference type selection interface shown in Fig. 13, the user can select the difference type he is concerned about, such as pixels, page element semantics, page structure, etc., page difference detection When the system 100 detects that the user places the cursor on the page structure, it can further display the page element style under the page structure, the position of the page element, the type of the page element, and the difference type for the user to choose and pay attention to.

示例性的,当页面差异检测系统100确定用户关注的差异类型是页面元素的样式和页面元素的语义,则页面差异检测系统100在待测GUI截图中提取出的第一信息为第一页面元素的样式信息和语义信息,第二信息为标准GUI截图中第二页面元素的样式信息和语义信息,页面差异检测系统100通过比较第一页面元素的样式信息和语义信息与第二页面元素的样式信息和语义信息,来确定待测GUI截图与标准GUI截图的差异。其中,第二页面元素与第一页面元素的类型、位置均相同,第一页面元素具体可以是待检测页面中的任一个页面元素,第二页面元素具体可以是待检测页面中的任一个页面元素。Exemplarily, when the page difference detection system 100 determines that the type of difference that the user focuses on is the style of the page element and the semantics of the page element, the first information extracted by the page difference detection system 100 in the screenshot of the GUI to be tested is the first page element. The second information is the style information and semantic information of the second page element in the standard GUI screenshot. The page difference detection system 100 compares the style information and semantic information of the first page element with the style of the second page element. information and semantic information to determine the difference between the GUI screenshot under test and the standard GUI screenshot. The type and location of the second page element and the first page element are the same. The first page element may be any page element in the pages to be detected, and the second page element may be any page in the pages to be detected. element.

进一步的,如图14所示,在自定义比对模式中,页面差异检测系统100还可以显示选择特定区域或者选择特定元素的界面,在该界面中用户还可以选择特定的页面元素(例如,图片元素、文字元素)来进行差异检测;或者,用户还可以选择待检测页面特定的区域来进行差异检测。Further, as shown in FIG. 14 , in the custom comparison mode, the page difference detection system 100 can also display an interface for selecting a specific area or selecting a specific element, in which the user can also select a specific page element (for example, Picture elements, text elements) to perform difference detection; or, the user can also select a specific area of the page to be detected for difference detection.

在上述实施例中,用户可以自主选择差异检测模式,有效满足用户对页面差异检测的多样化需求,并且,基于待检测页面和标准页面中的页面结构信息和/或页面元素语义信息来对待检测页面进行差异检测,有效提升页面差异检测的准确度,且有效扩大页面差异检测的粒度范围。In the above embodiment, the user can independently select the difference detection mode, which effectively meets the user's diverse needs for page difference detection, and based on the page structure information and/or page element semantic information in the page to be detected and the standard page. Page difference detection can effectively improve the accuracy of page difference detection, and effectively expand the granularity range of page difference detection.

可选的,页面差异检测系统100根据用户确定的目标检测模式对待检测页面和标准页面进行差异检测获得第一差异检测结果之后,还可以:接收第二操作;根据第二操作在待检测页面中确定出用户关注的第一区域图像,以及在标准页面中确定出与第一区域图像对应的第二区域图像;确定第一区域图像与第二区域图像之间的第二差异检测结果;第二差异检测结果包括第一区域图像与第二区域图像的像素差异信息、结构差异信息、语义差异信息中的至少一项;基于第一差异检测结果和第二差异检测结果,确定待检测页面与标准页面的第三差异检测结果,输出第三差异检测结果。如此,可以有效满足用户想重点关注待检测页面中部分区域是否与标准页面中的对应区域存在细节差异的需求,进而有效提升用户体验。Optionally, after the page difference detection system 100 performs difference detection between the page to be detected and the standard page according to the target detection mode determined by the user to obtain the first difference detection result, the system 100 may further: receive a second operation; Determine the first area image that the user pays attention to, and determine the second area image corresponding to the first area image in the standard page; determine the second difference detection result between the first area image and the second area image; second The difference detection result includes at least one of pixel difference information, structural difference information, and semantic difference information between the first area image and the second area image; based on the first difference detection result and the second difference detection result, determine the page to be detected and the standard The third difference detection result of the page is output, and the third difference detection result is output. In this way, the user's need to focus on whether there is a difference in detail between some areas in the to-be-detected page and the corresponding area in the standard page can be effectively met, thereby effectively improving the user experience.

在一种可能的实施例中,页面差异检测系统100以网页界面形式提供给用户使用时,页面差异检测系统100可以显示如图15所示的第一差异检测结果界面示意图,在该第一差异检测结果界面中用户可以选择直接输出第一差异检测结果,或者,选择对待检测页面的局部图像进行再次检测,进而页面差异检测系统100可以通过图15所示的第一差异检测结果界面中接收用户输入的该局部图像的位置信息、以及新的目标检测模式,基于该局部图像的位置信息在待检测页面中确定出用户关注的第一区域图像,以及在标准页面中确定出与第一区域图像对应的第二区域图像;基于新的目标检测模式对第一区域图像与第二区域图像进行二次检测,得到第二差异检测结果。In a possible embodiment, when the page difference detection system 100 is provided to the user in the form of a web interface, the page difference detection system 100 can display the schematic diagram of the first difference detection result interface as shown in FIG. 15 . In the detection result interface, the user can choose to directly output the first difference detection result, or choose to re-detect the partial image of the page to be detected, and then the page difference detection system 100 can receive the user through the first difference detection result interface shown in FIG. 15 . The input position information of the partial image and the new target detection mode, based on the position information of the partial image, determine the first area image of the user's attention in the page to be detected, and determine the first area image in the standard page. The corresponding second area image; based on the new target detection mode, the first area image and the second area image are subjected to secondary detection to obtain a second difference detection result.

示例性的,在页面差异检测系统100根据页面元素的语义比对模式对待测GUI截图和标准GUI截图进行差异检测,得到第一差异检测结果之后,页面差异检测系统100检测到用户输入了待测截图中的区域A的位置信息以及选择了像素比对模式,页面差异检测系统100统计区域A和标准GUI截图中与区域A对应的区域B的像素差异,得到第二差异检测结果,基于第一差异检测结果和第二差异检测结果得到最终的差异检测结果。Exemplarily, after the page difference detection system 100 performs difference detection between the GUI screenshot to be tested and the standard GUI screenshot according to the semantic comparison mode of the page elements, and obtains the first difference detection result, the page difference detection system 100 detects that the user has input the content to be tested. The position information of the area A in the screenshot and the pixel comparison mode is selected, the page difference detection system 100 counts the pixel difference between the area A and the area B corresponding to the area A in the standard GUI screenshot, and obtains the second difference detection result, based on the first difference detection result. The difference detection result and the second difference detection result obtain the final difference detection result.

在另一种可能的实施例中,页面差异检测系统100以应用程序接口形式提供给用户使用时,页面差异检测系统100可以通过命令用户界面(如图3A所示的IDE界面)接收用户输入的包含局部图像位置信息以及新的目标检测模式的程序代码,解析该程序代码,得到局部图像位置信息以及新的目标检测模式;基于该局部图像的位置信息在待检测页面中确定出用户关注的第一区域图像,以及在标准页面中确定出与第一区域图像对应的第二区域图像;以及基于新的目标检测模式对第一区域图像与第二区域图像进行二次检测,得到第二差异检测结果,基于第一差异检测结果和第二差异检测结果得到最终的差异检测结果。In another possible embodiment, when the page difference detection system 100 is provided to the user in the form of an application program interface, the page difference detection system 100 can receive the user input through a command user interface (the IDE interface shown in FIG. 3A ). The program code containing the local image position information and the new target detection mode, parse the program code to obtain the local image position information and the new target detection mode; based on the position information of the local image, determine the page to be detected that the user pays attention to. An area image, and a second area image corresponding to the first area image is determined in the standard page; and based on the new target detection mode, the first area image and the second area image are subjected to secondary detection to obtain a second difference detection As a result, a final difference detection result is obtained based on the first difference detection result and the second difference detection result.

可选的,页面差异检测系统100对待检测页面进行差异检测,获得第一差异检测结果之后,还可以输出第一差异检测结果,该第一差异检测结果包括待测网页在不同环境下的像素差异信息、页面结构差异信息、页面元素语义差异信息中的至少一项。其中,页面结构信息包括页面元素的类型、样式、位置等,本申请不做限制。Optionally, the page difference detection system 100 performs difference detection on the page to be detected, and after obtaining the first difference detection result, can also output the first difference detection result, where the first difference detection result includes the pixel difference of the webpage to be tested under different environments. At least one item of information, page structure difference information, and page element semantic difference information. Wherein, the page structure information includes types, styles, positions, etc. of page elements, which are not limited in this application.

示例性的,第一差异检测结果可以是页面元素的语义差异程度、像素差异程度、位置差异程度、类型差异程度、样式差异程度中一种或多种。如此,使得页面差异结果具体化,有效提升用户体验。Exemplarily, the first difference detection result may be one or more of semantic difference degree, pixel difference degree, position difference degree, type difference degree, and style difference degree of page elements. In this way, the page difference results are made concrete, and the user experience is effectively improved.

可选的,请参见图16,页面差异检测系统100得到差异检测结果之后,可以基于待测GUI截图组的基础信息(例如,环境信息)和差异检测结果,确定待测网页的兼容性测试结果。Optionally, referring to FIG. 16 , after the page difference detection system 100 obtains the difference detection result, it can determine the compatibility test result of the web page to be tested based on the basic information (for example, environmental information) of the GUI screenshot group to be tested and the difference detection result. .

示例性的,请参见表1,在表1中示出了待测网页在待测GUI截图1、待测GUI截图2、待测GUI截图3对应的操作系统环境下的谷歌浏览器的兼容性测试结果。Exemplarily, please refer to Table 1, in which Table 1 shows the compatibility of Google Chrome under the operating system environment corresponding to the GUI screenshot 1 to be tested, the screenshot 2 of the GUI to be tested, and the screenshot 3 of the GUI to be tested. Test Results.

表1Table 1

待测GUI截图Screenshot of the GUI to be tested 兼容性测试结果Compatibility Test Results 待测GUI截图1:Windows系统的谷歌浏览器5.0Screenshot of GUI to be tested 1: Google Chrome 5.0 for Windows 存在像素差异There are pixel differences 待测GUI截图2:linux系统的谷歌浏览器5.0Screenshot of GUI to be tested 2: Google Chrome 5.0 on Linux system 存在页面元素A的位置差异There is a positional difference for page element A 待测GUI截图3:Macos系统的谷歌浏览器5.0Screenshot 3 of GUI to be tested: Google Chrome 5.0 on Macos 不存在差异 no difference

在一种可能的实施例中,页面差异检测系统100以应用程序接口形式提供给用户使用时,页面差异检测系统100可以通过命令用户界面(如图3A所示的IDE界面)显示兼容性测试结果,或者,显示兼容性测试结果的文档下载链接。In a possible embodiment, when the page difference detection system 100 is provided to the user in the form of an application program interface, the page difference detection system 100 can display the compatibility test result through a command user interface (the IDE interface shown in FIG. 3A ). , or, a link to a document download showing compatibility test results.

在另一种可能的实施例中,页面差异检测系统100以网页界面形式提供给用户使用时,页面差异检测系统100可以通过图形用户界面将兼容性测试结果展示给用户,例如在图形用户界面显示如表1所示的页面;或者,页面差异检测系统100可以以文档形式提供给用户,在图形用户界面输出一个文档下载链接。In another possible embodiment, when the page difference detection system 100 is provided to the user in the form of a web interface, the page difference detection system 100 can display the compatibility test result to the user through a graphical user interface, for example, in the graphical user interface. The pages shown in Table 1; alternatively, the page difference detection system 100 may provide the user in the form of a document, and output a document download link on the graphical user interface.

可选的,页面差异检测系统100基于深度学习模型提取待检测页面和标准页面中的页面结构信息和/或页面语义信息之前,还可以对待测网页的GUI截图组(包括标准页面GUI 截图和一个或多个待测GUI截图)进行基本的图像处理(例如,灰度化、二值化等预处理)。如此,可以对图像进行降噪处理,进而有效提升页面结构信息和页面语义信息的识别精度。Optionally, before the page difference detection system 100 extracts the page structure information and/or page semantic information in the page to be detected and the standard page based on the deep learning model, a GUI screenshot group (including a standard page GUI screenshot and a or multiple screenshots of the GUI to be tested) and perform basic image processing (eg, preprocessing such as grayscale, binarization, etc.). In this way, the image can be denoised, thereby effectively improving the recognition accuracy of page structure information and page semantic information.

具体的,请参见图17,在图17中,页面差异检测系统100在获取到待检测页面(待测截图1、待测截图2等)和标准页面(标准GUI截图)之后,先对GUI截图组进行基本的图像处理之后,再基于深度学习模型提取待检测页面和标准页面的页面结构信息和或页面语义信息;进一步基于用户选择的目标检测模式(即比对模式中任一种),确定标准GUI 截图和待测GUI截图之间的第一差异检测结果。Specifically, please refer to FIG. 17 . In FIG. 17 , after acquiring the page to be detected (screenshot 1 to be tested, screenshot 2 to be tested, etc.) and the standard page (screenshot of standard GUI), the page difference detection system 100 first takes a screenshot of the GUI After the group performs basic image processing, the page structure information and/or page semantic information of the pages to be detected and standard pages are extracted based on the deep learning model; further, based on the target detection mode selected by the user (ie any of the comparison modes), determine The first difference detection result between the standard GUI screenshot and the GUI screenshot to be tested.

需要说明的是,图17所示的比对模式,可以分为预设模式和自定义模式。其中,预设模式中可以包括前述的像素比对模式,页面元素语义比对模式,页面布局比对模式。自定义模式中包括用户历史模板和用户新设模板,用户历史模板即为页面差异检测系统100根据用户上一次使用页面差异检测系统100进行页面差异检测时用户所关注的差异类型生成的历史比对模式、用户新设模板为页面差异检测系统100根据当前用户关注的差异类型生成的新的比对模式。It should be noted that the comparison mode shown in FIG. 17 can be divided into a preset mode and a custom mode. The preset mode may include the aforementioned pixel comparison mode, page element semantic comparison mode, and page layout comparison mode. The custom mode includes a user history template and a user-created template. The user history template is the historical comparison generated by the page difference detection system 100 according to the difference types that the user is concerned about when the user used the page difference detection system 100 to detect page differences last time. The pattern and the template newly set by the user are a new comparison pattern generated by the page difference detection system 100 according to the difference type concerned by the current user.

图18提供了一种计算设备,如图18所示,计算设备1800具体可以用于实现上述图1所示实施例中页面差异检测系统100的功能。FIG. 18 provides a computing device. As shown in FIG. 18 , the computing device 1800 may specifically be used to implement the functions of the system 100 for detecting page differences in the embodiment shown in FIG. 1 above.

计算设备1800包括总线1801、处理器1802、显示器1803和存储器1804。处理器1802、存储器1804和显示器1803之间通过总线1801通信。应理解,计算设备1800也可以不包括显示器1803,例如:计算设备1800为一种后台服务器,其通过接口与其他显示设备相连接,以通过其他显示设备实现显示界面的功能。Computing device 1800 includes bus 1801 , processor 1802 , display 1803 , and memory 1804 . Communication between the processor 1802 , the memory 1804 and the display 1803 is through the bus 1801 . It should be understood that the computing device 1800 may not include the display 1803. For example, the computing device 1800 is a kind of background server, which is connected with other display devices through interfaces, so as to realize the function of displaying the interface through other display devices.

总线1801可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图18中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 1801 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is shown in FIG. 18, but it does not mean that there is only one bus or one type of bus.

处理器1802可以为中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。The processor 1802 may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc. any one or more of the devices.

显示器1803是一种输入输出(input/output,I/O)设备。该设备可以将图形用户界面显示到屏幕上,以供用户进行相应的操作。根据制造材料不同,显示器1803可以分为液晶显示器(liquid crystal display,LCD)、有机电激光(organic light emitting diode,OLED)显示器等。具体地,显示器1803可以通过GUI显示用户输入的代码。The display 1803 is an input/output (I/O) device. The device can display a graphical user interface on the screen for the user to perform corresponding operations. According to different manufacturing materials, the display 1803 can be classified into a liquid crystal display (LCD), an organic light emitting diode (OLED) display, and the like. Specifically, the display 1803 may display the code input by the user through the GUI.

存储器1804可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器1804还可以包括非易失性存储器(non-volatilememory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard drivedrive,HDD) 或固态硬盘(solid state drive,SSD)。Memory 1804 may include volatile memory, such as random access memory (RAM). The memory 1804 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, hard drive drive (HDD) or solid state drive (SSD) ).

存储器1804中存储有可执行的程序代码,处理器1802执行该可执行的程序代码以执行前述页面差异检测方法。Executable program codes are stored in the memory 1804, and the processor 1802 executes the executable program codes to execute the aforementioned page difference detection method.

在一种可能的实施例中,处理器1802执行上述程序代码,以控制显示器1803通过图形用户界面接收用户操作,然后控制显示器1803通过总线1801传输用户操作至处理器1802,处理器1802可以根据用户操作,通过图形用户界面显示可选的比对模式,以及根据用户操作确定目标检测模式,并进行页面差异检测,并通过图形用户界面向用户返回差异检测结果。In a possible embodiment, the processor 1802 executes the above program codes to control the display 1803 to receive user operations through a graphical user interface, and then controls the display 1803 to transmit the user operations to the processor 1802 through the bus 1801. operation, display the optional comparison mode through the graphical user interface, and determine the target detection mode according to the user operation, and perform page difference detection, and return the difference detection result to the user through the graphical user interface.

在另一种可能的实施例中,处理器1802执行上述程序代码,以控制显示器1803通过命令用户界面接收用户输入的程序代码(例如,包含待测网页的URL、目标检测模式的相关参数的程序代码),然后控制显示器1803通过总线1801传输用户输入的程序代码至处理器1802,处理器1802可以根据用户输入的程序代码确定进行页面差异检测,并通过命令用户界面向用户返回差异检测结果。In another possible embodiment, the processor 1802 executes the above program code to control the display 1803 to receive program code input by the user through the command user interface (for example, a program including the URL of the webpage to be tested, the relevant parameters of the target detection mode) code), and then controls the display 1803 to transmit the program code input by the user to the processor 1802 through the bus 1801. The processor 1802 can determine to perform page difference detection according to the program code input by the user, and returns the difference detection result to the user through the command user interface.

在一些可能的实现方式中,处理器1802还可以控制其他接口接收用户输入的代码。其中,其他接口可以是麦克风等。具体地,麦克风可以接收以语音形式输入的代码。In some possible implementations, the processor 1802 may also control other interfaces to receive user-input codes. Wherein, the other interface may be a microphone or the like. Specifically, the microphone can receive the code entered in the form of speech.

本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行上述应用于页面差异检测系统的页面差异检测方法。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that contains one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like. The computer-readable storage medium includes instructions for instructing a computing device to execute the above-described page difference detection method applied to a page difference detection system.

本申请实施例还提供了一种计算机程序产品。所述计算机程序产品包括一个或多个计算机指令。在计算设备上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。The embodiments of the present application also provide a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computing device, all or part of the processes or functions described in the embodiments of the present application are generated.

所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机或数据中心进行传输。The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer or data center. (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) to another website site, computer or data center.

所述计算机程序产品可以为一个软件安装包,在需要使用前述页面差异检测方法的任一方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。The computer program product may be a software installation package, and when any of the foregoing methods for detecting page differences is required, the computer program product may be downloaded and executed on a computing device.

上述各个附图对应的流程或结构的描述各有侧重,某个流程或结构中没有详述的部分,可以参见其他流程或结构的相关描述。The descriptions of the processes or structures corresponding to each of the above-mentioned drawings have their own emphasis, and for the parts that are not described in detail in a certain process or structure, reference may be made to the related descriptions of other processes or structures.

Claims (22)

1.一种页面差异检测方法,其特征在于,所述方法包括:1. a page difference detection method, is characterized in that, described method comprises: 获取待检测页面和标准页面;Get the page to be detected and the standard page; 对所述待检测页面和所述标准页面进行处理,获得所述待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及所述标准页面的第二页面结构信息和/或第二页面元素语义信息;Process the to-be-detected page and the standard page to obtain first page structure information and/or first page element semantic information of the to-be-detected page, and second page structure information and/or of the standard page Semantic information of the second page element; 获取用户确定的目标检测模式;Obtain the target detection mode determined by the user; 根据所述目标检测模式、所述第一页面结构信息和/或所述第一页面元素语义信息、以及所述第二页面结构信息和/或所述第二页面元素语义信息,对所述待检测页面进行差异检测,获得第一差异检测结果。According to the target detection mode, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information, the The detection page performs difference detection to obtain a first difference detection result. 2.根据权利要求1所述的方法,其特征在于,所述目标检测模式包括以下模式中的一种或多种:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式。2. The method according to claim 1, wherein the target detection mode comprises one or more of the following modes: pixel comparison mode, page element semantic comparison mode, page layout comparison mode, automatic Define the alignment mode. 3.根据权利要求2所述的方法,其特征在于,当所述用户确定的所述目标检测模式包括所述页面元素语义比对模式时,所述对所述待检测页面进行差异检测,获得第一差异检测结果,包括:3 . The method according to claim 2 , wherein when the target detection mode determined by the user includes the page element semantic comparison mode, the difference detection is performed on the to-be-detected page, and the result is obtained: 4 . The first difference detection result, including: 比较所述第一页面元素语义信息与所述第二页面元素语义信息,确定所述第一差异检测结果。The first difference detection result is determined by comparing the semantic information of the first page element with the semantic information of the second page element. 4.根据权利要求2所述的方法,其特征在于,所述第一页面结构信息包括所述待检测页面中的页面元素的样式、位置或类型中的至少一个,所述第二页面结构信息包括所述标准页面中的页面元素的样式、位置或类型中的至少一个;当所述用户确定的所述目标检测模式包括所述页面布局比对模式时,所述对所述待检测页面进行差异检测,获得第一差异检测结果,包括:4. The method according to claim 2, wherein the first page structure information comprises at least one of styles, positions or types of page elements in the to-be-detected page, and the second page structure information Including at least one of the style, position or type of page elements in the standard page; when the target detection mode determined by the user includes the page layout comparison mode, performing the detection on the page to be detected. Difference detection, obtain the first difference detection result, including: 比较所述第一页面结构信息和所述第二页面结构信息,确定所述第一差异检测结果。The first difference detection result is determined by comparing the first page structure information with the second page structure information. 5.根据权利要求2所述的方法,其特征在于,当所述用户确定的所述目标检测模式包括所述自定义比对模式时,在对所述待检测页面进行差异检测之前,还包括:5 . The method according to claim 2 , wherein when the target detection mode determined by the user includes the user-defined comparison mode, before the difference detection is performed on the pages to be detected, the method further includes: 6 . : 接收第一命令或第一操作,根据所述第一命令或第一操作确定所述用户关注的差异类型;其中,所述差异类型包括像素、页面元素语义、页面结构中的一种或多种;Receive a first command or a first operation, and determine a difference type concerned by the user according to the first command or first operation; wherein the difference type includes one or more of pixels, page element semantics, and page structure ; 所述对所述待检测页面进行差异检测,获得第一差异检测结果,包括:The performing difference detection on the to-be-detected page to obtain a first difference detection result includes: 确定所述待检测页面中所述差异类型对应的第一信息,以及所述标准页面中所述差异类型对应的第二信息;根据所述第一信息和所述第二信息,确定所述第一差异检测结果。Determine the first information corresponding to the difference type in the to-be-detected page, and the second information corresponding to the difference type in the standard page; determine the first information according to the first information and the second information A difference detection result. 6.根据权利要求1-5任一项所述的方法,其特征在于,所述待检测页面为待测网页的第一图形用户界面GUI截图,所述标准页面为所述待测网页的标准GUI截图。6. The method according to any one of claims 1-5, wherein the page to be detected is a first graphical user interface GUI screenshot of the webpage to be tested, and the standard page is the standard of the webpage to be tested GUI screenshot. 7.根据权利要求6所述的方法,其特征在于,所述获取待检测页面和标准页面,包括:7. The method according to claim 6, wherein the acquiring the page to be detected and the standard page comprises: 获取所述用户输入的网页链接和/或所述网页链接所对应的网页页面中的超链接;Obtain the web page link input by the user and/or the hyperlink in the web page corresponding to the web page link; 基于所述网页链接和/或所述超链接,生成所述第一GUI截图和所述标准GUI截图。Based on the webpage link and/or the hyperlink, the first GUI screenshot and the standard GUI screenshot are generated. 8.根据权利要求1-7任一项所述的方法,其特征在于,所述对所述待检测页面进行差异检测,获得第一差异检测结果之后,所述方法还包括:8. The method according to any one of claims 1-7, characterized in that, after performing difference detection on the to-be-detected page and obtaining a first difference detection result, the method further comprises: 输出所述第一差异检测结果,所述第一差异检测结果包括所述待测页面的像素差异信息、结构差异信息、语义差异信息中的至少一项。The first difference detection result is output, where the first difference detection result includes at least one item of pixel difference information, structural difference information, and semantic difference information of the page to be tested. 9.根据权利要求1-8任一项所述的方法,其特征在于,所述对所述待检测页面和所述标准页面进行处理,获得所述待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及所述标准页面的第二页面结构信息和/或第二页面元素语义信息之前,还包括:9. The method according to any one of claims 1-8, wherein the processing of the page to be detected and the standard page is performed to obtain the first page structure information and/or the first page structure of the page to be detected. Or the semantic information of the first page element, and before the second page structure information and/or the semantic information of the second page element of the standard page, further include: 对海量网页在不同环境下的GUI截图进行训练,得到深度学习模型;Train GUI screenshots of massive web pages in different environments to obtain a deep learning model; 其中,所述深度学习模型的输入为任一GUI截图,输出为所述任一GUI截图中的页面结构信息和/或页面元素语义信息;Wherein, the input of the deep learning model is any GUI screenshot, and the output is the page structure information and/or page element semantic information in the any GUI screenshot; 所述对所述待检测页面和所述标准页面进行处理,获得所述待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及所述标准页面的第二页面结构信息和/或第二页面元素语义信息,包括:The processing of the to-be-detected page and the standard page is performed to obtain first page structure information and/or first page element semantic information of the to-be-detected page, and second page structure information and/or second page structure information of the standard page. / or second page element semantic information, including: 将所述待检测页面输入所述深度学习模型,基于所述深度学习模型输出所述第一页面结构信息和/或所述第一页面元素语义信息;以及,inputting the page to be detected into the deep learning model, and outputting the first page structure information and/or the first page element semantic information based on the deep learning model; and, 将所述标准页面输入所述深度学习模型,基于所述深度学习模型输出所述第二页面结构信息和/或所述第二页面元素语义信息。The standard page is input into the deep learning model, and the second page structure information and/or the second page element semantic information is output based on the deep learning model. 10.根据权利要求1-9任一项所述的方法,所述对所述待检测页面进行差异检测,获得第一差异检测结果之后,所述方法还包括:10. The method according to any one of claims 1-9, wherein after performing difference detection on the to-be-detected page and obtaining a first difference detection result, the method further comprises: 接收第二操作;根据所述第二操作在所述待检测页面中确定出所述用户关注的第一区域图像,以及在所述标准页面中确定出与所述第一区域图像对应的第二区域图像;receiving a second operation; determining a first area image of the user's attention in the to-be-detected page according to the second operation, and determining a second area image corresponding to the first area image in the standard page area image; 确定所述第一区域图像与所述第二区域图像之间的第二差异检测结果;所述第二差异检测结果包括所述第一区域图像与所述第二区域图像的像素差异信息、结构差异信息、语义差异信息中的至少一项;Determine a second difference detection result between the first area image and the second area image; the second difference detection result includes pixel difference information and structure of the first area image and the second area image At least one of difference information and semantic difference information; 基于所述第一差异检测结果和所述第二差异检测结果,确定所述待检测页面与所述标准页面的第三差异检测结果,输出所述第三差异检测结果。Based on the first difference detection result and the second difference detection result, a third difference detection result between the page to be detected and the standard page is determined, and the third difference detection result is output. 11.一种页面差异检测系统,其特征在于,包括:11. A system for detecting page differences, comprising: 处理单元,用于获取待检测页面和标准页面,对所述待检测页面和所述标准页面进行处理,获得所述待检测页面的第一页面结构信息和/或第一页面元素语义信息,以及所述标准页面的第二页面结构信息和/或第二页面元素语义信息;a processing unit, configured to acquire a page to be detected and a standard page, process the page to be detected and the standard page, and obtain first page structure information and/or first page element semantic information of the page to be detected, and Second page structure information and/or second page element semantic information of the standard page; 接口单元,用于获取用户确定的目标检测模式;an interface unit for acquiring the target detection mode determined by the user; 所述处理单元,还用于根据所述目标检测模式、所述第一页面结构信息和/或所述第一页面元素语义信息、以及所述第二页面结构信息和/或所述第二页面元素语义信息,对所述待检测页面进行差异检测,获得第一差异检测结果。The processing unit is further configured to detect the mode according to the target, the first page structure information and/or the first page element semantic information, and the second page structure information and/or the second page element semantic information, and perform difference detection on the to-be-detected page to obtain a first difference detection result. 12.根据权利要求11所述的系统,其特征在于,所述目标检测模式包括以下模式中的一种或多种:像素比对模式、页面元素语义比对模式、页面布局比对模式、自定义比对模式。12. The system according to claim 11, wherein the target detection mode comprises one or more of the following modes: pixel comparison mode, page element semantic comparison mode, page layout comparison mode, automatic Define the alignment mode. 13.根据权利要求12所述的系统,其特征在于,当所述用户确定的所述目标检测模式包括所述页面元素语义比对模式时,所述处理单元在用于对所述待检测页面进行差异检测,获得第一差异检测结果时,具体用于:13 . The system according to claim 12 , wherein when the target detection mode determined by the user includes the page element semantic comparison mode, the processing unit is configured to detect the page to be detected. 14 . When difference detection is performed and the first difference detection result is obtained, it is specifically used for: 比较所述第一页面元素语义信息与所述第二页面元素语义信息,确定所述第一差异检测结果。The first difference detection result is determined by comparing the semantic information of the first page element with the semantic information of the second page element. 14.根据权利要求12所述的系统,其特征在于,所述第一页面结构信息包括所述待检测页面中的页面元素的样式、位置或类型中的至少一个,所述第二页面结构信息包括所述标准页面中的页面元素的样式、位置或类型中的至少一个;14. The system according to claim 12, wherein the first page structure information comprises at least one of styles, positions or types of page elements in the to-be-detected page, and the second page structure information including at least one of the style, position or type of page elements in the standard page; 当所述用户确定的所述目标检测模式包括所述页面布局比对模式时,所述处理单元在用于对所述待检测页面进行差异检测,获得第一差异检测结果时,具体用于:When the target detection mode determined by the user includes the page layout comparison mode, when the processing unit is configured to perform difference detection on the to-be-detected page and obtain a first difference detection result, the processing unit is specifically configured to: 比较所述第一页面结构信息和所述第二页面结构信息,确定所述第一差异检测结果。The first difference detection result is determined by comparing the first page structure information with the second page structure information. 15.根据权利要求12所述的系统,其特征在于,当所述用户确定的所述目标检测模式包括所述自定义比对模式时,在所述处理单元用于对所述待检测页面进行差异检测之前,所述接口单元还用于:接收第一命令或第一操作;15 . The system according to claim 12 , wherein when the target detection mode determined by the user includes the user-defined comparison mode, the processing unit is configured to perform a process on the to-be-detected page. 16 . Before the difference detection, the interface unit is further configured to: receive a first command or a first operation; 所述处理单元还用于:根据所述第一命令或第一操作确定所述用户关注的差异类型;其中,所述差异类型包括像素、页面元素语义、页面结构中的一种或多种;The processing unit is further configured to: determine the difference type concerned by the user according to the first command or the first operation; wherein the difference type includes one or more of pixels, page element semantics, and page structure; 所述处理单元在用于对所述待检测页面进行差异检测,获得第一差异检测结果时,具体用于:When the processing unit is used to perform difference detection on the to-be-detected page and obtain a first difference detection result, it is specifically used for: 确定所述待检测页面中所述差异类型对应的第一信息,以及所述标准页面中所述差异类型对应的第二信息;根据所述第一信息和所述第二信息,确定所述第一差异检测结果。Determine the first information corresponding to the difference type in the to-be-detected page, and the second information corresponding to the difference type in the standard page; determine the first information according to the first information and the second information A difference detection result. 16.根据权利要求11-15任一项所述的系统,其特征在于,所述待检测页面为待测网页的第一图形用户界面GUI截图,所述标准页面为所述待测网页的标准GUI截图。16. The system according to any one of claims 11-15, wherein the page to be detected is a screenshot of a first graphical user interface (GUI) of the web page to be tested, and the standard page is a standard of the web page to be tested GUI screenshot. 17.根据权利要求16所述的系统,其特征在于,所述处理单元在用于待检测页面和标准页面时,具体用于:17. The system according to claim 16, wherein when the processing unit is used for the page to be detected and the standard page, it is specifically used for: 获取所述用户输入的网页链接和/或所述网页链接所对应的网页页面中的超链接;obtaining the web page link input by the user and/or the hyperlink in the web page corresponding to the web page link; 基于所述网页链接和/或所述超链接,生成所述第一GUI截图和所述标准GUI截图。Based on the webpage link and/or the hyperlink, the first GUI screenshot and the standard GUI screenshot are generated. 18.根据权利要求11-17任一项所述的系统,其特征在于,所述处理单元在用于对所述待检测页面进行差异检测,获得第一差异检测结果之后,18. The system according to any one of claims 11-17, wherein after the processing unit is configured to perform difference detection on the to-be-detected page and obtain a first difference detection result, 输出所述第一差异检测结果,所述第一差异检测结果包括所述待测页面的像素差异信息、结构差异信息、语义差异信息中的至少一项。The first difference detection result is output, where the first difference detection result includes at least one item of pixel difference information, structural difference information, and semantic difference information of the page to be tested. 19.根据权利要求11-18任一项所述的系统,其特征在于,所述处理单元还用于:19. The system according to any one of claims 11-18, wherein the processing unit is further configured to: 在用于对所述待检测页面和所述标准页面进行处理之前,对海量网页在不同环境下的GUI截图进行训练,得到深度学习模型;其中,所述深度学习模型的输入为任一GUI截图,输出为所述任一GUI截图中的页面结构信息和/或页面元素语义信息;Before being used to process the to-be-detected page and the standard page, a deep learning model is obtained by training GUI screenshots of massive web pages in different environments; wherein the input of the deep learning model is any GUI screenshot , the output is the page structure information and/or page element semantic information in any of the GUI screenshots; 所述处理单元在用于对所述待检测页面和所述标准页面进行处理时,具体用于:When the processing unit is used to process the to-be-detected page and the standard page, it is specifically used for: 将所述待检测页面输入所述深度学习模型,基于所述深度学习模型输出所述第一页面结构信息和/或所述第一页面元素语义信息;以及,inputting the page to be detected into the deep learning model, and outputting the first page structure information and/or the first page element semantic information based on the deep learning model; and, 将所述标准页面输入所述深度学习模型,基于所述深度学习模型输出所述第二页面结构信息和/或所述第二页面元素语义信息。The standard page is input into the deep learning model, and the second page structure information and/or the second page element semantic information is output based on the deep learning model. 20.根据权利要求11-19任一项所述的系统,所述接口单元还用于:在所述处理单元对所述待检测页面进行差异检测,获得第一差异检测结果之后,接收第二操作;20. The system according to any one of claims 11-19, wherein the interface unit is further configured to: after the processing unit performs difference detection on the to-be-detected page and obtains a first difference detection result, receive a second difference detection result. operate; 所述处理单元还用于:根据所述第二操作在所述待检测页面中确定出所述用户关注的第一区域图像,以及在所述标准页面中确定出与所述第一区域图像对应的第二区域图像;确定所述第一区域图像与所述第二区域图像之间的第二差异检测结果;所述第二差异检测结果包括所述第一区域图像与所述第二区域图像的像素差异信息、结构差异信息、语义差异信息中的至少一项;基于所述第一差异检测结果和所述第二差异检测结果,确定所述待检测页面与所述标准页面的第三差异检测结果;The processing unit is further configured to: determine, according to the second operation, a first area image that the user is concerned about in the to-be-detected page, and determine, in the standard page, a first area image corresponding to the first area image the second area image; determine the second difference detection result between the first area image and the second area image; the second difference detection result includes the first area image and the second area image at least one of pixel difference information, structural difference information, and semantic difference information; based on the first difference detection result and the second difference detection result, determine the third difference between the to-be-detected page and the standard page Test results; 所述接口单元,还用于输出所述第三差异检测结果。The interface unit is further configured to output the third difference detection result. 21.一种计算设备,其特征在于,所述设备包括处理器、存储器;21. A computing device, wherein the device comprises a processor and a memory; 所述处理器用于执行所述存储器中存储的指令,以使得所述计算设备执行如权利要求1至10中任一项所述的方法。The processor is adapted to execute instructions stored in the memory to cause the computing device to perform the method of any one of claims 1 to 10. 22.一种计算机可读存储介质,其特征在于,包括指令,当其在计算设备上运行时,所述计算设备执行如权利要求1至10中任一项所述的方法。22. A computer-readable storage medium comprising instructions which, when executed on a computing device, perform the method of any one of claims 1 to 10.
CN202011373863.5A 2020-11-30 2020-11-30 A kind of page difference detection method and system Pending CN114579420A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011373863.5A CN114579420A (en) 2020-11-30 2020-11-30 A kind of page difference detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011373863.5A CN114579420A (en) 2020-11-30 2020-11-30 A kind of page difference detection method and system

Publications (1)

Publication Number Publication Date
CN114579420A true CN114579420A (en) 2022-06-03

Family

ID=81767925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011373863.5A Pending CN114579420A (en) 2020-11-30 2020-11-30 A kind of page difference detection method and system

Country Status (1)

Country Link
CN (1) CN114579420A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858401A (en) * 2023-02-27 2023-03-28 成都光合信号科技有限公司 Page detection method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858401A (en) * 2023-02-27 2023-03-28 成都光合信号科技有限公司 Page detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113190781B (en) Page layout method, device, equipment and storage medium
US11461689B2 (en) Techniques for automatically testing/learning the behavior of a system under test (SUT)
WO2019153604A1 (en) Device and method for creating human/machine identification model, and computer readable storage medium
US8381094B1 (en) Incremental visual comparison of web browser screens
US10810113B2 (en) Method and apparatus for creating reference images for an automated test of software with a graphical user interface
CN113282488B (en) Terminal test method and device, storage medium and terminal
CN110990010A (en) Software interface code generation method and device
CN107179859A (en) The display methods and mobile terminal of a kind of detail information
CN104881273A (en) Webpage rendering analysis method and terminal device
CN115269359A (en) Terminal interface testing method and device
CN113778429A (en) Walk-through method, walk-through device and storage medium
CN114116441A (en) UI (user interface) testing method and device, electronic equipment and storage medium
CN112612469A (en) Interface element processing method and device and electronic equipment
US20140006932A1 (en) Web page update notification device and web page update notification method
CN114579420A (en) A kind of page difference detection method and system
CN114782955A (en) Buried point processing method, electronic device, and storage medium
CN114283437A (en) Legend identification method, device, equipment and storage medium
CN112083974A (en) Advertisement window closing method and device and electronic equipment
CN111428452A (en) Comment data storage method and device
CN102866888B (en) User interface map target disposal route and system
KR101966423B1 (en) Method for image matching and apparatus for executing the method
JP6790886B2 (en) Information processing programs, information processing methods and information processing equipment
CN116150517A (en) Page processing method and device, electronic equipment and medium
CN112783483B (en) Function creation method, device, equipment and medium based on floating button component
CN104407763A (en) Content input method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination