UI element analysis method and system of human-computer interaction interface, terminal and medium
Through semantic area segmentation and functional UI element detection, combined with text information matching, the accuracy and complexity of UI element parsing in human-computer interaction interfaces are solved, and intelligent parsing of UI elements and automated processes in visual scenes are realized. promote.
Patent Information
- Application Number
- CN202410636353.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-22
AI Technical Summary
The existing technology is difficult to accurately identify and parse functional UI elements in human-computer interaction interfaces, especially in dynamic and complex layouts, and cannot effectively integrate visual and text information, limiting the execution effect of automated tasks and the intelligence level of the process. .
Obtain block structure information through semantic area segmentation and refined processing, combine functional UI element detection and text information matching, analyze the nested relationship between UI elements, and provide a human-computer interaction interface UI element that does not rely on HTML code Intelligent analysis method.
It achieves intelligent analysis of UI elements in purely visual scenarios, improves the accuracy and efficiency of recognition and operation of automated tools, adapts to dynamically changing human-computer interaction interface design, and expands the generalization and flexibility of RPA.
Smart Images

Figure CN118587713A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and natural language processing, and in particular to a method, system, terminal and medium for parsing UI elements of a human-computer interaction interface. Background Art
[0002] In the digital age, the human-computer interaction interface, as the main medium for information dissemination, carries rich text, images and interactive elements. The combination of computer vision and natural language processing aims to improve the machine's ability to understand the content of the human-computer interaction interface, which is crucial for fields such as information extraction, content management, and automated interaction. However, current robotic process automation (RPA) technology is mainly limited to web page scenarios and relies on HTML structural rule parsing or HTML-based content parsing; this means that any update to the HTML structure requires the redevelopment of related parsing tools, increasing the complexity and cost of maintenance. In addition, for environments where HTML code cannot be directly accessed, such as mobile applications or desktop application systems, existing technologies cannot effectively identify and understand functional UI elements.
[0003] Although existing text recognition and image processing technologies can extract and understand the content of human-computer interaction interfaces to a certain extent, these technologies show obvious limitations in the face of the diversity and complexity of functional UI elements in human-computer interaction interface scenarios. First, human-computer interaction interface UI elements include a variety of interactive components, such as buttons, input boxes, drop-down boxes, radio buttons, check boxes, etc., which are not only visually varied, but also often accompanied by complex business logic. Existing technologies have difficulty in accurately identifying and parsing these elements, especially in dynamic human-computer interaction interfaces and complex layouts. Secondly, although current technical strategies attempt to parse some visual elements when dealing with human-computer interaction interfaces, they often ignore the nesting and hierarchical relationships between elements. This structural information is crucial for accurately mapping and operating interfaces. Without in-depth analysis of these modular and hierarchical designs, automated tools cannot effectively identify the dependencies and interactions between elements, thereby limiting the accuracy and efficiency of operations. Finally, although the comprehensive use of multimodal information makes it possible to understand complex interfaces, existing parsing technologies usually process visual and text data independently, failing to achieve effective fusion of these two types of information. As a result, existing systems often fail to correctly understand the functions and contexts of UI elements with complex visual and textual content, such as icons with labels or buttons for specific operations, which affects the execution effect of automated tasks and the intelligence level of the process.
[0004] With the development of Robotic Process Automation (RPA) technology, intelligent analysis of UI elements in general human-computer interaction interfaces has become particularly important. In automated business processes, RPA systems need to be able to accurately identify and operate various functional UI elements in the human-computer interaction interface to achieve operations such as data entry, information retrieval, and online transactions. This requires not only a high degree of accuracy to prevent errors in business processes, but also sufficient speed and flexibility to adapt to the ever-changing human-computer interaction interface design and updates.
[0005] In the field of human-computer interaction interface element analysis, the early traditional methods mainly focused on rule-based analysis of HTML code in web page scenarios. Although this strategy performs well when dealing with simple, standard web pages, its efficiency and accuracy are often limited for complex and dynamically generated content. Secondly, with the update and iteration of web page scene content, the existing human-computer interaction interface PRA process also needs to be updated, which to a certain extent limits the widespread application of traditional methods.
[0006] With the rise of deep learning methods, especially the development of large language models in the field of natural language processing (NLP), more and more studies have begun to explore the application of these models to RPA tasks in web scenarios. In the early deep learning methods, HTML was used as the main input to the model in the hope of achieving an overall understanding of the web page and completing tasks such as web page function summary and operation navigation. These language model-based methods try to grasp the structure and semantics of the web page interface by parsing the HTML source code of the page. However, this method has an essential flaw, that is, it is overly dependent on the quality of the HTML source code of the web page interface. Since a large number of web pages in reality have irregular code writing, and the HTML source code is usually not enough to convey rich visual and structural information, this limits the generalization ability and practicality of such methods. At the same time, the above methods are still limited to web scenarios and cannot be extended to more general human-computer interaction interface scenarios, such as mobile applications or desktop application systems.
[0007] In recent years, more and more studies have attempted to solve the problem of understanding the content of human-computer interaction interfaces through a multimodal model framework that combines visual models with language information. This marks a technical shift from single-modality to multimodal understanding, and brings new possibilities for parsing elements of human-computer interaction interfaces in visual scenarios. However, existing related technologies still do not solve the limitations encountered in updating and managing complexity of human-computer interaction interfaces, that is, to achieve robust UI element parsing for general human-computer interaction interfaces in a single visual scene; at the same time, the input of existing multimodal understanding technologies in web page scenarios is web page images + web page DOM information, but there is no way to obtain web page DOM information in visual scenarios; in order to understand DOM information, existing multimodal understanding technologies in web page scenarios often use large language models, which brings about a large inference delay. Summary of the invention
[0008] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method, system, terminal and medium for parsing UI elements of a human-computer interaction interface.
[0009] According to one aspect of the present invention, a method for parsing UI elements of a human-computer interaction interface is provided, comprising:
[0010] Performing semantic region segmentation on the human-computer interaction interface image, and performing fine processing on the result of the semantic region segmentation to obtain block structure information of the human-computer interaction interface;
[0011] Position and identify functional UI elements in human-computer interaction interface images;
[0012] Extract text information in a specific area of the human-computer interaction interface image;
[0013] The text information is matched with the functional UI element, and the functional UI element is merged with the block structure information, and the nested relationship between the functional UI elements is analyzed to obtain the UI element analysis result of the human-computer interaction interface.
[0014] Preferably, the semantic region segmentation is performed on the human-computer interaction interface image, and the result of the semantic region segmentation is refined to obtain the block structure information of the human-computer interaction interface, including:
[0015] A pre-trained general visual segmentation model is provided, the model comprising: an image encoder and a mask decoder;
[0016] In the image encoder part of the general visual segmentation model, a comprehensive human-computer interaction interface segmentation adaptive fine-tuning module is provided;
[0017] Freezing some parameters of the image encoder of the general visual segmentation model, and training the general visual segmentation model using parameters in the integrated human-computer interaction interface segmentation adaptive fine-tuning module;
[0018] Fine-tuning the structure of the mask decoder part of the general visual segmentation model to adapt to the image segmentation result obtained from the integrated human-computer interaction interface segmentation adaptive fine-tuning module to obtain a semantic region segmentation model;
[0019] Using the semantic region segmentation model to perform semantic region segmentation on the human-computer interaction interface image;
[0020] A post-processing module is provided, and the result of the semantic region segmentation is refined by the post-processing module to obtain block structure information of the human-computer interaction interface, where the block structure information is a structured block containing a set of logically related UI elements.
[0021] Preferably, the integrated human-computer interaction interface segmentation adaptive fine-tuning module comprises: an image block fine-tuning module, a structural feature fine-tuning module and an adapter module; wherein:
[0022] The image block fine-tuning module projects the human-computer interaction interface image embedding from a high-dimensional space into a reduced-dimensional feature space through an adjustable linear layer, so as to optimize the alignment between the pre-trained model and the target dataset;
[0023] The structural feature fine-tuning module pre-processes the input human-computer interaction interface image and converts it into a grayscale image, calculates the gradient amplitude using the Sobel operator to identify the edge and structural features in the human-computer interaction interface image; segments the obtained edge and structural features into non-overlapping image blocks consistent with the general visual segmentation model, and projects these image blocks into a feature space with reduced dimensionality using an adjustable linear layer, so as to optimize the structural representation of the human-computer interaction interface image;
[0024] The adapter module combines the outputs of the image segmentation fine-tuning module and the structural feature fine-tuning module, and uses a lightweight multi-layer perceptron to perform feature enhancement for a specific web page field to obtain an image segmentation result.
[0025] Preferably, the post-processing module comprises: a spatial context collaborative segmentation and fusion module and an OCR-driven text boundary refinement module, wherein:
[0026] The spatial context collaborative segmentation fusion module is used to merge overlapping segmentation frames in the visual segmentation results output by the refined general visual segmentation model;
[0027] The OCR-driven text boundary refinement module utilizes text data extracted from the OCR technology to refine and correct the position of the segmentation box.
[0028] Preferably, the positioning and identifying functional UI elements of the human-computer interaction interface image includes:
[0029] Provide a pre-trained general visual detection model;
[0030] Providing a human-computer interaction scene UI element dataset, using the dataset to optimize and train the general visual detection model to obtain a UI element detection model in the human-computer interaction scene;
[0031] The human-computer interaction interface image is used as the input of the UI element detection model, and the positioning and recognition results of the functional UI elements in the human-computer interaction interface image are obtained as output.
[0032] Preferably, the extracting text information in a specific area of the human-computer interaction interface image includes:
[0033] Provide a pre-trained OCR text detection model, which is used to obtain complete web page text information;
[0034] Based on the expert system, errors and application requirements in the actual web page text detection process are obtained, and the complete web page text information is filtered to obtain text information in a specific area in the human-computer interaction interface image.
[0035] Preferably, the matching of the text information with the functional UI element, fusing the functional UI element with the block structure information, parsing the nested relationship between the functional UI elements, and obtaining the UI element parsing result of the human-computer interaction interface includes:
[0036] Based on the prior distribution of UI element text information, a UI text matching algorithm is constructed, and the functional UI element is accurately matched with the corresponding text information using the UI text matching algorithm;
[0037] Based on the block structure information of the human-computer interaction interface, a UI block fusion algorithm is constructed, and the functional UI elements are fused with the block structure information using the UI block fusion algorithm to obtain a UI nested description of the human-computer interaction interface and obtain a UI element parsing result of the human-computer interaction interface.
[0038] Preferably, the UI text matching algorithm includes:
[0039] Obtain the UI element text information distribution prior, and construct a relative position description based on the UI element text information distribution prior. The relative position description is used to describe the distribution law D of different functional UI elements and text information:
[0040]
[0041] In the formula, (x UI ,y UI ) and (x text ,y text ) respectively describe the center point coordinates of UI elements and text information, (w UI ,h) and (w text ,h text ) respectively describe the width and height of UI elements and text information; for different functional UI elements, the distribution of the above distribution law D is statistically analyzed to obtain the distribution mean and variance var, will As the prior range of text information distribution of corresponding UI elements;
[0042] Calculate the text information area ratio of the UI element, traverse each UI element detection result, and calculate the ratio K of the overlapping area between the UI element and the text information to the text information area:
[0043]
[0044] In the formula, Union(UI,text) refers to the area of the overlap between the UI element and the text information, S text Indicates the area of text information; when K is greater than the set threshold, the text information is used as the text information description of the corresponding UI element;
[0045] Let T be the set of text information descriptions that can be obtained for each UI element; for UI elements that match a single text information, if len(T) ≥ 1, only the corresponding text information description with the largest K is taken; if len(T) = 0, then based on the obtained text information distribution prior range, the text information closest to the UI element is taken as its text information description; for UI elements that match multiple text information, calculate the maximum area M formed by the UI element and each text information outside the set T:
[0046]
[0047] Take the corresponding text information with the smallest M as the additional description of the text information of the UI element and add it to the set T;
[0048] For the obtained text information description set T corresponding to the UI element, sort the distances between the text information description coordinates in set T and the image coordinate origin (0,0) from small to large to obtain an ordered set As a final set of text descriptions of UI elements;
[0049] For the final text description set Deviation correction and overlap correction are performed respectively, and the obtained results are used again as the text information description of the corresponding UI element to complete the accurate matching between the UI element and its corresponding text information.
[0050] Preferably, the UI block fusion algorithm includes:
[0051] Initialize a possibly nested block structure information index list for each UI element;
[0052] Recursively traverse the block structure information index list by utilizing the spatial relationship between the bounding box and the block bounding box, and optimize the matching relationship between the UI element and the block structure information;
[0053] Filtering the matching relationship between the UI element and the block structure information based on a set matching strategy;
[0054] The matching relationship between the filtered UI elements and the block structure information is optimized to ensure that each UI element can be parsed in the logically correct block structure information; for UI elements that are not successfully matched in the block structure information, the UI element is associated with other nearest block structure information to ensure that each UI element is in the most appropriate position, completing the fusion between the UI elements and the block structure information, and obtaining the UI nested description of the human-computer interaction interface.
[0055] According to another aspect of the present invention, a UI element parsing system for a human-computer interaction interface is provided, comprising:
[0056] A block segmentation module, which is used to perform semantic region segmentation on the human-computer interaction interface image and perform fine processing on the result of the semantic region segmentation to obtain block structure information of the human-computer interaction interface;
[0057] UI detection module, which is used to locate and identify functional UI elements in the human-computer interaction interface image;
[0058] A text recognition module, which is used to extract text information in a specific area of a human-computer interaction interface image;
[0059] A fusion analysis module is used to match the text information with the UI elements, fuse the UI elements with the block structure information, analyze the nested relationship between the functional UI elements, and obtain the UI element analysis result of the human-computer interaction interface.
[0060] According to a third aspect of the present invention, there is provided a computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, can be used to execute any one of the methods described above in the present invention, or to run the system described above in the present invention.
[0061] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can be used to execute any of the methods described above in the present invention, or to run the system described above in the present invention.
[0062] Due to the adoption of the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art:
[0063] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the present invention provide, in a purely visual scenario, an intelligent parsing technology for UI elements of the human-computer interaction interface that does not rely on HTML code. The technology can not only effectively understand the visual information in the human-computer interaction interface in the absence of HTML information, but also capture the text information in the human-computer interaction interface, so that the model can process the content of the human-computer interaction interface more directly and effectively, providing new possibilities for the parsing of human-computer interaction interface elements, promoting the advancement of human-computer interaction interface processing technology, and providing a more powerful and flexible tool for the automation process of human-computer interaction interface scenarios.
[0064] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the present invention directly understand the UI elements and their structures through a visual model without relying on the HTML information of the web page scene, thereby realizing intelligent parsing of UI elements in a pure visual web page scene.
[0065] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the present invention, by combining the UI detection model with the text extraction model, expands the traditional RPA method based on HTML rule parsing from web page scenarios to general human-computer interaction scenarios. In general human-computer interaction scenarios, such as mobile applications, desktop applications or web page scenarios, intelligent parsing of UI elements can be achieved, effectively improving the generalization of RPA of the human-computer interaction interface.
[0066] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the present invention provide a nested relationship of functional UI elements through a precise block segmentation algorithm, effectively identify and parse the functional UI elements in the human-computer interaction interface scenario, and improve the efficiency and accuracy of automated tools in processing the content of the human-computer interaction interface in actual operation, especially in a dynamic and changeable human-computer interaction interface environment.
[0067] The UI element parsing method, system, terminal and medium for the human-computer interaction interface provided by the present invention significantly improve the accuracy and adaptability of human-computer interaction interface element parsing by combining the intuitive perception of computer vision and the deep semantic understanding of natural language processing, so that it can flexibly respond to various human-computer interaction interface design changes, reduce errors and improve efficiency in RPA tasks.
[0068] The UI element parsing method, system, terminal and medium for the human-computer interaction interface provided by the present invention can be further expanded to include further reasoning about the intelligent parsing results of UI elements in the human-computer interaction scenario of intelligent parsing, and to realize the prediction of the human-computer interaction interface process, thereby completing the implementation of a fully automated parsing reasoning model of the PRA process in a general human-computer interaction scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0070] Figure 1 The present invention is a flowchart of a method for parsing UI elements in a human-computer interaction interface in a preferred embodiment of the present invention.
[0071] Figure 2 It is a workflow diagram of the human-computer interaction interface block segmentation in a preferred embodiment of the present invention.
[0072] Figure 3 It is a workflow diagram of the fusion construction module in a preferred embodiment of the present invention.
[0073] Figure 4 The figure is a schematic diagram of the component modules of the UI element parsing system of the human-computer interaction interface in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0074] The following is a detailed description of the embodiments of the present invention: This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
[0075] In view of the limitations of the existing human-computer interaction interface robotic process automation (RPA) technology in human-computer interaction interface updating and complexity management, an embodiment of the present invention provides a method for parsing UI elements of a human-computer interaction interface, which is used to parse UI elements of a human-computer interaction interface, is suitable for robotic process automation (RPA) operations in visual scenes, and can automatically understand and parse functional UI elements of the human-computer interaction interface and their associated text content. Through this method, in a purely visual environment, it is possible to achieve efficient recognition and parsing of complex human-computer interaction interface UI structures directly through image and text data without relying on HTML code, significantly improving the accuracy and application scope of robotic process automation.
[0076] Specifically, if Figure 1 As shown, the UI element parsing method of the human-computer interaction interface provided by this embodiment may include the following operations:
[0077] S1, performing semantic region segmentation on the human-computer interaction interface image, and performing fine processing on the result of the semantic region segmentation to obtain the block structure information of the human-computer interaction interface;
[0078] S2, locates and identifies functional UI elements in the human-computer interaction interface image;
[0079] S3, extracting text information in a specific area of the human-computer interaction interface image;
[0080] S4, matching the text information with the functional UI elements, integrating the functional UI elements with the block structure information, parsing the nested relationship between the functional UI elements, and obtaining the UI element parsing result of the human-computer interaction interface.
[0081] In some preferred embodiments, Figure 2 As shown, the above S1, performing semantic region segmentation on the human-computer interaction interface image, and performing fine processing on the result of the semantic region segmentation to obtain the block structure information of the human-computer interaction interface, may further include the following operations:
[0082] S11, providing a pre-trained general visual segmentation model, the model comprising: an image encoder and a mask decoder;
[0083] S12, in the image encoder part of the general visual segmentation model, providing a comprehensive human-computer interaction interface segmentation adaptive fine-tuning module;
[0084] S13, freezing some parameters of the image encoder of the general visual segmentation model, and training the general visual segmentation model using parameters in the integrated human-computer interaction interface segmentation adaptive fine-tuning module;
[0085] S14, fine-tuning the structure of the mask decoder part of the general visual segmentation model to adapt to the image segmentation result obtained from the comprehensive human-computer interaction interface segmentation adaptation fine-tuning module to obtain a semantic region segmentation model;
[0086] S15, performing semantic region segmentation on the human-computer interaction interface image using a semantic region segmentation model;
[0087] S16, providing a post-processing module, using the post-processing module to perform fine processing on the result of the semantic area segmentation to obtain block structure information of the human-computer interaction interface, where the block structure information is a structured block containing a set of logically related UI elements.
[0088] In some preferred implementations, the above S11, providing a pre-trained general visual segmentation model, may further include the following operations:
[0089] A general visual segmentation model is provided, and parameters of the general visual segmentation model are trained using a public training data set to obtain a pre-trained general visual segmentation model.
[0090] In some preferred embodiments, the above S12, the integrated human-computer interaction interface segmentation adaptive fine-tuning module, may further include: an image block fine-tuning module, a structural feature fine-tuning module and an adapter module; wherein:
[0091] The image block fine-tuning module projects the human-computer interaction interface image embedding from a high-dimensional space into a reduced-dimensional feature space through an adjustable linear layer, which is used to optimize the alignment between the pre-trained model and the target dataset;
[0092] The structural feature fine-tuning module pre-processes the input human-computer interaction interface image and converts it into a grayscale image, calculates the gradient amplitude using the Sobel operator to identify the edge and structural features in the human-computer interaction interface image; segments the obtained edge and structural features into non-overlapping image blocks consistent with the general visual segmentation model, and uses an adjustable linear layer to project these image blocks into a reduced-dimensional feature space to optimize the structural representation of the human-computer interaction interface image;
[0093] The adapter module combines the outputs of the image block fine-tuning module and the structural feature fine-tuning module, and uses a lightweight multi-layer perceptron to perform feature enhancement for specific web page fields to obtain image segmentation results.
[0094] In some preferred embodiments, the above S16, the post-processing module, may further include: a spatial context collaborative segmentation and fusion module and an OCR-driven text boundary refinement module, wherein:
[0095] The spatial context collaborative segmentation fusion module is used to merge the overlapping segmentation boxes in the visual segmentation results output by the refined general visual segmentation model;
[0096] The OCR-driven text boundary refinement module uses the text data extracted from the OCR technology to refine and correct the position of the segmentation box.
[0097] In some preferred embodiments, the spatial context collaborative segmentation fusion module is used to merge the overlapping segmentation boxes in the visual segmentation results output by the refined general visual segmentation model, and may further include the following operations:
[0098] S1611, performing spatial analysis on the detected bounding boxes to calculate the position and size of each bounding box and the overlapping area between them;
[0099] S1612, according to the spatial analysis result, merging the overlapping or adjacent bounding boxes into a single bounding box, thereby completing the merging of the overlapping segmentation boxes in the visual segmentation result.
[0100] In some preferred embodiments, the OCR-driven text boundary refinement module, which uses text data extracted from the OCR technology to refine and correct the position of the segmentation box, may further include the following operations:
[0101] S1621, using OCR technology to recognize text data in the human-computer interaction interface image to obtain a corresponding text box;
[0102] S1622, performing cluster analysis on the text frame using a DBSCAN algorithm to identify the regional distribution of the text data;
[0103] S1623, adjusting the position and size of the segmentation frame according to the clustering results of the text frame and the distribution results of the text data, to ensure that the segmentation frame can accurately cover the relevant text data area.
[0104] In some preferred implementations, the above S2, locating and identifying functional UI elements in the segmented image of the human-computer interaction interface area, may further include the following operations:
[0105] S21, provides a pre-trained general visual detection model;
[0106] S22, providing a human-computer interaction scene UI element dataset, using the dataset to optimize and train a general visual detection model to obtain a UI element detection model in the human-computer interaction scene;
[0107] S23, using the human-computer interaction interface image as input of the UI element detection model, and outputting the positioning and recognition results of the functional UI elements in the human-computer interaction interface image.
[0108] In some preferred implementations, the above S21, providing a pre-trained general visual detection model, may further include the following operations:
[0109] A general visual detection model is provided, and parameters of the general visual detection model are trained using a public training data set to obtain a pre-trained general visual detection model.
[0110] In some preferred implementations, the above S3, extracting text information in a specific area of the human-computer interaction interface area segmentation image, may further include the following operations:
[0111] S31, providing a pre-trained OCR text detection model, the model is used to obtain complete web page text information; the model has a strong recognition ability for various text formats and layouts in human-computer interaction interface images, including processing text information in multiple fonts, sizes, colors and languages;
[0112] S32, based on the errors and application requirements obtained in the actual web page text detection process by the expert system, the complete web page text information is filtered.
[0113] In some preferred embodiments, Figure 3 As shown, the above S4 matches the text information with the functional UI elements, merges the functional UI elements with the block structure information, analyzes the nested relationship between the functional UI elements, and obtains the UI element analysis result of the human-computer interaction interface, and can further include the following operations:
[0114] S41, constructing a UI text matching algorithm based on the prior distribution of UI element text information, and using the UI text matching algorithm to accurately match the functional UI elements with their corresponding text information;
[0115] S42, based on the block structure information of the human-computer interaction interface, construct a UI block fusion algorithm, use the UI block fusion algorithm to fuse the functional UI elements with the block structure information, obtain the UI nested description of the human-computer interaction interface, and obtain the UI element parsing result of the human-computer interaction interface.
[0116] In some preferred implementations, the above S41, UI text matching algorithm, may further include the following operations:
[0117] S411, obtaining a priori distribution of UI element text information, and constructing a relative position description based on the priori distribution of UI element text information. The relative position description is used to describe the distribution law D of different functional UI elements and text information:
[0118]
[0119] In the formula, (x UI ,y UI ) and (x text ,y text ) respectively describe the center point coordinates of UI elements and text information, (w UI ,h) and (w text ,h text ) respectively describe the width and height of UI elements and text information; for different functional UI elements, the distribution of the above distribution law D is statistically analyzed to obtain the distribution mean and variance var, will As the prior range of text information distribution of corresponding UI elements;
[0120] S412, calculating the text information area ratio of the UI element, traversing each UI element detection result, and calculating the ratio K of the overlapping area between the UI element and the text information to the text information area:
[0121]
[0122] In the formula, Union(UI,text) refers to the area of the overlap between the UI element and the text information, S text Indicates the area of text information; when K is greater than the set threshold, the text information is used as the text information description of the corresponding UI element;
[0123] S413, let T be the set of text information descriptions that can be obtained for each UI element; for a UI element that matches a single text information, if len(T) ≥ 1, then only the corresponding text information description with the largest K is taken; if len(T) = 0, then based on the obtained prior range of text information distribution, the text information closest to the UI element is taken as its text information description; for a UI element that matches multiple text information, calculate the maximum area M formed by the UI element and each text information outside the set T:
[0124]
[0125] Take the corresponding text information with the smallest M as the additional description of the text information of the UI element and add it to the set T;
[0126] S414, for the obtained text information description set T corresponding to the UI element, sort the distances between the text information description coordinates in the set T and the image coordinate origin (0,0) from small to large to obtain an ordered set As a final set of text descriptions of UI elements;
[0127] S415, for the final text description set obtained Deviation correction and overlap correction are performed respectively, and the obtained results are used again as the text information description of the corresponding UI element to complete the accurate matching between the UI element and its corresponding text information.
[0128] In some preferred implementations, the above S42, UI block fusion algorithm, may further include the following operations:
[0129] S421, initializing a possibly nested block structure information index list for each UI element;
[0130] S422, using the spatial relationship between the bounding box and the block bounding box, recursively traverse the block structure information index list to optimize the matching relationship between the UI element and the block structure information;
[0131] S423, filtering the matching relationship between the UI element and the block structure information based on the set matching strategy;
[0132] S424, optimize the matching relationship between the filtered UI elements and the block structure information to ensure that each UI element can be parsed in the logically correct block structure information. The parsing refers to the process of obtaining the category information, nested information and text information of the UI element. For UI elements that are not successfully matched in the block structure information, associate the UI element with the nearest other block structure information to ensure that each UI element can be in the most appropriate position, complete the fusion between the UI element and the block structure information, and obtain the UI nested description of the human-computer interaction interface.
[0133] The UI element parsing method of the human-computer interaction interface provided by the above embodiment of the present invention combines computer vision technology and can identify and parse the UI elements of the human-computer interaction interface in a pure visual environment, significantly improving the accuracy and efficiency of the recognition and parsing of UI elements of the human-computer interaction interface in the automation process, so as to cope with the dynamically changing human-computer interaction interface design and content updates, thereby reducing the complexity and maintenance workload of RPA development caused by the update of the human-computer interaction interface. By achieving more accurate and efficient visual parsing, the UI element parsing method of the human-computer interaction interface provided by the above embodiment of the present invention can optimize the response speed and operational reliability of automation tools, adapt to the changing human-computer interaction interface environment, and improve the performance and generalization of the overall automation process.
[0134] The technical solution provided by the above embodiment of the present invention is further described in detail below in conjunction with a preferred embodiment.
[0135] like Figure 1 As shown, it is a workflow diagram of the UI element parsing method of the human-computer interaction interface in the preferred embodiment, which includes the following steps:
[0136] S1, block segmentation, uses the visual segmentation model and post-processing module to perform semantic regional segmentation processing on the human-computer interaction interface image to obtain block structure information such as the functional attributes of each regional module of the human-computer interaction interface and the nested relationship between modules.
[0137] S2, UI detection, detects, locates and identifies functional UI elements in human-computer interaction interface images, such as text boxes, buttons, drop-down boxes, etc., by specially building and training UI element detection models.
[0138] S3, text recognition, is used to extract text information in a specific area from the human-computer interaction interface image; including text location coordinates and text description content.
[0139] S4, fusion analysis, this module integrates text and functional UI elements, and accurately analyzes the nested relationship between UI elements through the nested description between UI elements and block structure information to obtain the UI element analysis results of the human-computer interaction interface.
[0140] In a preferred embodiment, S1 is implemented using Figure 2 The efficient human-computer interaction interface segmentation and adaptation method shown includes the following steps:
[0141] S1-1, provide a pre-selected visual segmentation model, which includes: an image encoder and a mask decoder; wherein, a general visual segmentation model with high-resolution input (1024×1024 pixels) is used as the basic architecture, and the pre-trained model parameters are obtained through training with public training data sets (such as public data sets such as imagenet-1k) to ensure that the model has good basic performance for general visual tasks. At the same time, obtain a human-computer interaction interface segmentation data set, and perform standardization processing on the images therein, such as adjusting brightness, contrast, and normalizing image size, to ensure the consistency of input data and the adaptability of the model, which is used to fine-tune the training of the general visual segmentation model.
[0142] S1-2, improve the image encoder part of the visual segmentation model, introduce a comprehensive human-computer interaction interface segmentation adaptive fine-tuning module, which includes: image block fine-tuning module, structural feature fine-tuning module and adapter module, aiming to improve the model's representation ability and generalization performance for specific human-computer interaction interfaces through fine-tuning and fusion; among them:
[0143] The image block fine-tuning module projects the original image embedding (i.e., the human-computer interaction interface image embedding) from a high-dimensional space into a reduced-dimensional feature space through an adjustable linear layer, which is used to optimize the alignment between the pre-trained model and the target dataset;
[0144] The structural feature fine-tuning module pre-processes the input human-computer interaction interface image and converts it into a grayscale image, calculates the gradient amplitude using the Sobel operator to identify the edge and structural features in the human-computer interaction interface image; segments the obtained edge and structural features into non-overlapping image blocks consistent with the general visual segmentation model, and uses an adjustable linear layer to project these image blocks into a reduced-dimensional feature space to optimize the structural representation of the human-computer interaction interface image;
[0145] The adapter module combines the outputs of the image block fine-tuning module and the structural feature fine-tuning module, and uses a lightweight multi-layer perceptron to perform feature enhancement for specific web page domains.
[0146] S1-3, during the training phase, the integrated human-computer interaction interface segmentation adaptive fine-tuning module is used to fine-tune the model, including: freezing the original image encoder parameters, and fine-tuning the mask decoder structure to optimize the model performance; wherein, freezing some parameters of the image encoder of the general visual segmentation model, and training the general visual segmentation model using the parameters in the integrated human-computer interaction interface segmentation adaptive fine-tuning module; fine-tuning the structure of the mask decoder part of the general visual segmentation model to adapt to the image segmentation results obtained from the integrated human-computer interaction interface segmentation adaptive fine-tuning module to obtain a semantic region segmentation model; and using the semantic region segmentation model to perform semantic region segmentation on the human-computer interaction interface image.
[0147] S1-4, introduce a post-processing module, which does not participate in the model training process, and is specifically used to further process the output obtained from the trained model to improve the accuracy and practicality of the segmentation results; the post-processing module includes: a spatial context collaborative segmentation fusion module and an OCR-driven text boundary refinement module, where:
[0148] The spatial context collaborative segmentation fusion module is specifically used to process the collaborative fusion of visual segmentation results, and is used to merge the overlapping segmentation frames in the visual segmentation results output by the refined general visual segmentation model, so as to improve the overall accuracy of the results by merging the overlapping segmentation frames; further preferably, it includes the following steps:
[0149] Perform spatial analysis on the detected bounding boxes to calculate the position, size, and overlap area of each bounding box.
[0150] According to the spatial analysis results, the overlapping or adjacent bounding boxes are merged into a single bounding box, completing the merging of the overlapping segmentation boxes in the visual segmentation results.
[0151] The OCR-driven text boundary refinement module uses text data extracted from the OCR technology to refine and correct the position of the segmentation box, thereby improving the accuracy and usability of the overall segmentation result; further preferably, it includes the following steps:
[0152] Use OCR technology to recognize text data in the human-computer interaction interface image and obtain the corresponding text box;
[0153] Use DBSCAN algorithm to cluster text boxes and identify the regional distribution of text data;
[0154] According to the clustering results of the text boxes and the distribution results of the text data, the position and size of the segmentation box are adjusted to ensure that the segmentation box can accurately cover the relevant text data area.
[0155] In a preferred embodiment, implementing S2 includes the following steps:
[0156] S2-1, initialization stage, provides a pre-trained general visual detection model; wherein, a general visual detection model with high-resolution input (1024×1024 pixels) is used as the basic architecture, and the pre-trained model parameters are obtained through training with a public training data set to ensure that the model has good basic performance for general visual tasks. At the same time, for the images in the training data set, standardization processing is performed, such as adjusting brightness, contrast, and normalizing image size to ensure the consistency of input data and the adaptability of the model.
[0157] S2-2, training phase, based on the constructed human-computer interaction scene UI element dataset, fine-tune the visual detection model, optimize the model performance, and obtain the final UI element detection model in the human-computer interaction scene. In this step, the human-computer interaction scene UI element dataset is constructed, which can be obtained by manually annotating the UI elements in the scene image, which can contain more than 20K images and more than 20 categories of UI to achieve UI intelligent parsing of general human-computer interaction scenes.
[0158] S2-3, using the human-computer interaction interface image as the input of the UI element detection model, and outputting the positioning and recognition results of the functional UI elements in the human-computer interaction interface image.
[0159] In a preferred embodiment, implementing S3 includes the following steps:
[0160] S3-1, text detection, provides a pre-trained OCR text detection model; among them, the OCR text detection model with high-resolution input (1024×1024 pixels) is used as the basic architecture, and the existing open source Chinese and English OCR model parameters are used to ensure that the model has good basic performance for Chinese and English texts to obtain complete web page text information.
[0161] S3-2, text filtering, filters the complete web page text information obtained above based on the errors and application requirements found in the actual web page text detection process through extensive testing of the expert system.
[0162] In a preferred embodiment, S4 is implemented using Figure 3 The fusion analysis method shown includes the following steps:
[0163] S4-1, UI-text matching, based on the prior information of UI elements and their corresponding texts in the collected webpage data set, a specific UI-text matching algorithm is constructed to achieve accurate matching of UI elements and their corresponding text descriptions. Further preferably, for special UI elements, such as input boxes, drop-down boxes, etc., matching of multiple text elements can be achieved to ensure sufficient description of the UI elements. The specific operations are as follows:
[0164] S4-1-1, obtain the prior distribution of UI element text information, and obtain the prior distribution of functional UI elements and text descriptions based on the pre-collected web page data set. The following relative position description is designed to describe the rules of different functional UI elements and text descriptions:
[0165]
[0166] In the above formula (x UI ,y UI ) and (x text ,y text ) respectively describe the center point coordinates of UI elements and text, (w UI ,h) and (w text ,h text ) respectively describe the width and height of UI elements and text. For different functional UI elements, the distribution of D is statistically analyzed to obtain the distribution mean. and variance var, will As the text distribution prior range of the corresponding UI element.
[0167] S4-1-2, calculate the text area ratio of the UI element, traverse each UI detection result, and calculate the ratio K of the overlapping area between the UI and the text to the text area. The formula is as follows
[0168]
[0169] In the above formula, Union(UI,text) refers to the area of the overlap between UI and text, S text Refers to the text area; if K>0.5, the text is used as the text description of the corresponding UI.
[0170] S4-1-3, UI element text matching, each UI in the above formula can obtain the corresponding text description set T. For UI elements that only require a single text, if len(T) ≥ 1, only the corresponding text description with the largest K is taken; if len(T) = 0, then based on the text distribution prior range obtained in S4-1-1, the text closest to the UI is taken as its text description. For multi-text matching UI elements, such as input boxes, drop-down boxes, etc., the above method often intelligently obtains the corresponding text in the UI element, but cannot obtain the corresponding description text of the UI element, such as "name", etc. Therefore, for these UI elements, the maximum area M composed of the UI element and each text outside the set T will be calculated. The formula is as follows:
[0171]
[0172] Take the corresponding text with the smallest M as the additional description text of the UI element and add it to the set T.
[0173] S4-1-4, text description sorting. For the text description set T corresponding to the obtained UI, calculate the distance between the description coordinates of the text in the set T and the image coordinate origin (0,0) and sort them from small to large to obtain an ordered set. A collection of text descriptions of the UI.
[0174] S4-1-5, text matching post-processing, for the obtained text description set Post-processing optimization is performed, which mainly includes two steps: (1) bias correction. Calculate whether the corresponding text position and UI element have a large pixel-level deviation on the X-axis or Y-axis; for example, the corresponding element of the radio button and the text description are basically consistent on the Y-axis, and are closer and on the left side on the X-axis; if there is a large deviation, the existing text description will be removed and the matching process from S4-1-2 to S4-1-4 will be repeated. (2) Overlap correction, for the obtained text description set Calculate whether there is a large IOU between the corresponding text position and the UI element: For example, for elements such as buttons, the text description and the UI position highly overlap and have a large IOU, and the text outside the UI element is not the description text of the corresponding element. Therefore, in this case, the image passing through the UI element area is passed through the OCR text recognition model alone, and the obtained result is used as the text description of the corresponding UI.
[0175] S4-2, UI-block fusion, based on the block structure information of the human-computer interaction interface obtained in step S1, a specific UI-block fusion algorithm is constructed to fuse the UI element information and the block structure information to obtain the UI nested description of the human-computer interaction interface as the UI element intelligent parsing result of the human-computer interaction interface. The specific operations are as follows:
[0176] S4-2-1, UI and block initialization matching. In this sub-step, a possibly nested block node index list is first initialized for each UI element. By starting from the root node of the entire interface, this operation establishes a basic association framework for hierarchical structural analysis of UI elements. This initialization ensures that the subsequent precise matching steps can be performed on a clearly defined structure.
[0177] S4-2-2, recursive exploration and matching refinement. After the initial matching, the next step is to refine the matching between the UI and the block by recursively traversing the block structure of the human-computer interaction interface. In this process, the inclusion relationship between the two is determined based on the spatial relationship between the bounding box of the UI element and the bounding box of the block. This recursive exploration not only checks whether each block contains a specific UI element, but also updates the information of the block node and records which UI elements are associated with it. The key to this step is to accurately place the UI element in its logically correct block, ensuring the accuracy of the structured description of the UI.
[0178] S4-2-3, block type selection and application of matching strategy. Furthermore, this step takes into account the matching impact of different types of blocks on UI elements, especially large content blocks, such as advertisements or background images. Here, different strategies are applied depending on whether UI elements are matched with large content blocks. By adjusting the matching algorithm to include or exclude these blocks, various UI design scenarios can be handled more flexibly, thereby better adapting to different interface layout requirements. In this step, the matching strategy specifically includes:
[0179] Block type identification: First, identify interface elements that are large content blocks. These interface elements are usually image-intensive or media-intensive areas, including large advertising banners, video playback areas, or visually attractive background images.
[0180] Matching condition settings: Set conditions to determine whether to match UI elements with these large content blocks. This includes considering the functional requirements of UI elements and the visual characteristics of blocks. For example, for UI elements that require user interaction (such as buttons or input boxes), avoid matching with background blocks that are visually disturbing.
[0181] Spatial relationship assessment: Analyze the spatial relationship of UI elements to large content blocks to determine whether they should be logically associated.
[0182] Matching strategy enforcement: Implement specific matching strategies to decide in which cases UI elements should be associated with large content blocks, or should be excluded from these blocks. This involves adjusting the bounding box of UI elements to better fit their functional blocks, or modifying the properties of the blocks to reduce visual interference with UI elements.
[0183] S4-2-4, optimize the relationship between the UI and the block after matching. This step optimizes the relationship between the UI and the block obtained after the matching process, including adjusting the relationship between the UI elements and the blocks to ensure that each UI element can be identified and interpreted in a logically correct block. Among them, special attention is paid to the processing of similar UI elements. Similar UI elements refer to UI components that are similar in category and size. By analyzing the distribution of these components in a specific block, they are matched with the corresponding text descriptions to ensure that the function and purpose of each UI component are accurately explained. In addition, the matching results are optimized, including adjusting the relationship between the UI elements and the blocks to ensure that each UI element can be identified and interpreted in a logically correct block. This process not only improves the accuracy of UI parsing, but also enhances the user interaction quality of the interface. Finally, for UI elements that are not successfully matched in large content blocks, try to associate them with the nearest sub-blocks to further optimize the overall interface structure and ensure that each UI element is in the most appropriate position. Through the above steps, not only the relationship between the UI and the block is optimized, but also the functionality and usability of the entire user interface are improved, ensuring the coherence and efficiency of the interaction design.
[0184] An embodiment of the present invention provides a UI element parsing system for a human-computer interaction interface.
[0185] Specifically, Figure 4 As shown, the UI element parsing system for the human-computer interaction interface provided by this embodiment may include the following modules:
[0186] A block segmentation module is used to perform semantic region segmentation on the human-computer interaction interface image and perform fine processing on the result of semantic region segmentation to obtain the block structure information of the human-computer interaction interface;
[0187] UI detection module, which is used to locate and identify functional UI elements in the human-computer interaction interface image;
[0188] A text recognition module, which is used to extract text information in a specific area of a human-computer interaction interface image;
[0189] The fusion analysis module is used to match text information with UI elements, fuse UI elements with block structure information, analyze the nested relationship between functional UI elements, and obtain the UI element analysis results of the human-computer interaction interface.
[0190] It should be noted that the steps in the method provided by the present invention can be implemented by using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the method to realize the composition of the system, that is, the embodiments in the method can be understood as preferred examples for constructing the system, which will not be elaborated here.
[0191] An embodiment of the present invention further provides a computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the processor can be used to execute any method of the above-mentioned embodiments of the present invention, or to run any system of the above-mentioned embodiments of the present invention.
[0192] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store computer programs (such as applications, functional modules, etc. that implement the above method), computer instructions, etc., and the above computer programs, computer instructions, etc. can be partitioned and stored in one or more memories. And the above computer programs, computer instructions, data, etc. can be called by the processor.
[0193] The above-mentioned computer programs, computer instructions, etc. may be stored in one or more memories in partitions, and the above-mentioned computer programs, computer instructions, data, etc. may be called by a processor.
[0194] The processor is used to execute the computer program stored in the memory to implement the various steps of the method or various modules of the system involved in the above embodiments. For details, please refer to the relevant descriptions in the above method and system embodiments.
[0195] The processor and the memory may be independent structures or integrated structures. When the processor and the memory are independent structures, the memory and the processor may be coupled and connected via a bus.
[0196] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it can be used to execute any method of the above embodiments of the present invention, or to run any system of the above embodiments of the present invention.
[0197] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0198] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0199] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0200] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0201] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0202] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0203] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the above-mentioned embodiments of the present invention belong to a human-computer interaction interface UI element intelligent parsing technology based on visual scenes, which overcomes the limitations of the traditional human-computer interaction interface UI element HTML rule parsing in this field. By introducing element detection and text extraction, functional UI elements and their text information are extracted from the human-computer interaction interface image in the visual scene. By constructing a general functional UI data set in the human-computer interaction interface scene, the model's detection capability for UI element content in the human-computer interaction interface scene is significantly improved.
[0204] The UI element parsing method, system, terminal and medium of the human-computer interaction interface provided by the above-mentioned embodiments of the present invention use block segmentation technology to further segment the existing visual human-computer interaction interface image content into structured blocks, providing structured information for the nested relationship construction of UI elements in the human-computer interaction interface; through the fusion construction technology, the detected functional UI elements and the extracted text information are associated with the image-text matching algorithm, and the nesting and logical relationship between the elements are constructed in combination with the block segmentation results to conform to the cognitive structure of user interaction; the technical solution provided by the above-mentioned embodiments of the present invention not only successfully detects and identifies functional UI elements in the visual scene of the human-computer interaction interface, but also provides text information description and nested relationship description for different UI elements, and makes the model more accurate and efficient in actual application scenarios (such as human-computer interaction interface RPA).
[0205] All matters not covered in the above embodiments of the present invention are well known in the art.
[0206] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for parsing UI elements in a human-computer interaction interface, characterized in that: include: Performing semantic region segmentation on the human-computer interaction interface image, and performing fine processing on the result of the semantic region segmentation to obtain block structure information of the human-computer interaction interface; Position and identify functional UI elements in human-computer interaction interface images; Extract text information in a specific area of the human-computer interaction interface image; The text information is matched with the functional UI element, and the functional UI element is merged with the block structure information, and the nested relationship between the functional UI elements is analyzed to obtain the UI element analysis result of the human-computer interaction interface.
2. The UI element parsing method of the human-computer interaction interface according to claim 1, characterized in that: The semantic region segmentation is performed on the human-computer interaction interface image, and the result of the semantic region segmentation is refined to obtain the block structure information of the human-computer interaction interface, including: A pre-trained general visual segmentation model is provided, the model comprising: an image encoder and a mask decoder; In the image encoder part of the general visual segmentation model, a comprehensive human-computer interaction interface segmentation adaptive fine-tuning module is provided; Freezing some parameters of the image encoder of the general visual segmentation model, and training the general visual segmentation model using parameters in the integrated human-computer interaction interface segmentation adaptive fine-tuning module; Fine-tuning the structure of the mask decoder part of the general visual segmentation model to adapt to the image segmentation result obtained from the integrated human-computer interaction interface segmentation adaptive fine-tuning module to obtain a semantic region segmentation model; Using the semantic region segmentation model to perform semantic region segmentation on the human-computer interaction interface image; A post-processing module is provided, and the result of the semantic region segmentation is refined by the post-processing module to obtain block structure information of the human-computer interaction interface, where the block structure information is a structured block containing a set of logically related UI elements.
3. The UI element parsing method of the human-computer interaction interface according to claim 2, characterized in that: Also includes any one or more of the following: -The integrated human-computer interaction interface segmentation adaptive fine-tuning module includes: an image block fine-tuning module, a structural feature fine-tuning module and an adapter module; wherein: The image block fine-tuning module projects the human-computer interaction interface image embedding from a high-dimensional space into a reduced-dimensional feature space through an adjustable linear layer, so as to optimize the alignment between the pre-trained model and the target dataset; The structural feature fine-tuning module pre-processes the input human-computer interaction interface image and converts it into a grayscale image, calculates the gradient amplitude using the Sobel operator to identify the edge and structural features in the human-computer interaction interface image; segments the obtained edge and structural features into non-overlapping image blocks consistent with the general visual segmentation model, and projects these image blocks into a feature space with reduced dimensionality using an adjustable linear layer, so as to optimize the structural representation of the human-computer interaction interface image; The adapter module combines the outputs of the image segmentation fine-tuning module and the structural feature fine-tuning module, and uses a lightweight multi-layer perceptron to perform feature enhancement for a specific web page domain to obtain an image segmentation result; - The post-processing module includes: a spatial context collaborative segmentation and fusion module and an OCR-driven text boundary refinement module, wherein: The spatial context collaborative segmentation fusion module is used to merge overlapping segmentation frames in the visual segmentation results output by the refined general visual segmentation model; The OCR-driven text boundary refinement module utilizes text data extracted from the OCR technology to refine and correct the position of the segmentation box.
4. The UI element parsing method of the human-computer interaction interface according to claim 1, characterized in that: The positioning and identification of functional UI elements in the human-computer interaction interface image includes: Provide a pre-trained general visual detection model; Providing a human-computer interaction scene UI element dataset, using the dataset to optimize and train the general visual detection model to obtain a UI element detection model in the human-computer interaction scene; The human-computer interaction interface image is used as the input of the UI element detection model, and the positioning and recognition results of the functional UI elements in the human-computer interaction interface image are obtained as output.
5. The UI element parsing method of the human-computer interaction interface according to claim 1, characterized in that: The extracting of text information in a specific area of the human-computer interaction interface image includes: Provide a pre-trained OCR text detection model, which is used to obtain complete web page text information; Based on the expert system, errors and application requirements in the actual web page text detection process are obtained, and the complete web page text information is filtered to obtain text information in a specific area in the human-computer interaction interface image.
6. The UI element parsing method of the human-computer interaction interface according to claim 1, characterized in that: The matching of the text information with the functional UI element, fusing the functional UI element with the block structure information, parsing the nested relationship between the functional UI elements, and obtaining the UI element parsing result of the human-computer interaction interface includes: Based on the prior distribution of UI element text information, a UI text matching algorithm is constructed, and the functional UI element is accurately matched with the corresponding text information using the UI text matching algorithm; Based on the block structure information of the human-computer interaction interface, a UI block fusion algorithm is constructed, and the functional UI elements are fused with the block structure information using the UI block fusion algorithm to obtain a UI nested description of the human-computer interaction interface and obtain a UI element parsing result of the human-computer interaction interface.
7. The UI element parsing method of the human-computer interaction interface according to claim 1, characterized in that: Also includes any one or more of the following: -The UI text matching algorithm includes: Obtain the UI element text information distribution prior, and construct a relative position description based on the UI element text information distribution prior. The relative position description is used to describe the distribution law D of different functional UI elements and text information: In the formula, (x UI ,y UI ) and (x text ,y text ) respectively describe the center point coordinates of UI elements and text information, (w UI ,h) and (w text ,h text ) respectively describe the width and height of UI elements and text information; for different functional UI elements, the distribution of the above distribution law D is statistically analyzed to obtain the distribution mean and variance var, will As the prior range of text information distribution of corresponding UI elements; Calculate the text information area ratio of the UI element, traverse each UI element detection result, and calculate the ratio K of the overlapping area between the UI element and the text information to the text information area: In the formula, Union(UI,text) refers to the area of the overlap between the UI element and the text information, S text Indicates the area of text information; when K is greater than the set threshold, the text information is used as the text information description of the corresponding UI element; Let T be the set of text information descriptions that can be obtained for each UI element; for UI elements that match a single text information, if len(T) ≥ 1, only the corresponding text information description with the largest K is taken; if len(T) = 0, then based on the obtained text information distribution prior range, the text information closest to the UI element is taken as its text information description; for UI elements that match multiple text information, calculate the maximum area M formed by the UI element and each text information outside the set T: Take the corresponding text information with the smallest M as the additional description of the text information of the UI element and add it to the set T; For the obtained text information description set T corresponding to the UI element, sort the distances between the text information description coordinates in set T and the image coordinate origin (0,0) from small to large to obtain an ordered set As a final set of text descriptions of UI elements; For the final text description set Deviation correction and overlap correction are performed respectively, and the obtained results are used as the text information description of the corresponding UI element again to complete the accurate matching between the UI element and its corresponding text information; -The UI block fusion algorithm includes: Initialize a possibly nested block structure information index list for each UI element; Recursively traverse the block structure information index list by utilizing the spatial relationship between the bounding box and the block bounding box, and optimize the matching relationship between the UI element and the block structure information; Filtering the matching relationship between the UI element and the block structure information based on a set matching strategy; The matching relationship between the filtered UI elements and the block structure information is optimized to ensure that each UI element can be parsed in the logically correct block structure information; for UI elements that are not successfully matched in the block structure information, the UI element is associated with other nearest block structure information to ensure that each UI element can be in the most appropriate position, complete the fusion between UI elements and block structure information, and obtain the UI nested description of the human-computer interaction interface.
8. A UI element parsing system for a human-computer interaction interface, characterized in that: include: A block segmentation module, which is used to perform semantic region segmentation on the human-computer interaction interface image and perform fine processing on the result of the semantic region segmentation to obtain block structure information of the human-computer interaction interface; UI detection module, which is used to locate and identify functional UI elements in the human-computer interaction interface image; A text recognition module, which is used to extract text information in a specific area of a human-computer interaction interface image; A fusion analysis module is used to match the text information with the UI elements, fuse the UI elements with the block structure information, analyze the nested relationship between the functional UI elements, and obtain the UI element analysis result of the human-computer interaction interface.
9. A computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it can be used to perform the method described in any one of claims 1 to 7, or to run the system described in claim 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can be used to perform the method described in any one of claims 1 to 7, or to run the system described in claim 8.
Citation Information
Patent Citations
UI interface test method and device, electronic equipment and storage medium
CN114116441A
Vascular ultrasound intima automatic measurement method and system based on template matching
CN117333529A
Image Segmentation Using Reduced Foreground Training Data
US20110216965A1
Cited By
Method and system for generating software electronic specification based on large language model
CN119557436A
Automatic test script dynamic generation method and system based on multi-modal AI identification
CN120011247A
Zero-code multi-terminal application automatic construction method based on AI semantic understanding
CN120144107A
A zero-code multi-terminal application automatic construction method based on AI semantic understanding
CN120144107B
Mobile terminal agent information processing system based on prior rule and multi-modal large model
CN120161973A
