Method and device for identifying page component layout mode, equipment and storage medium

By automatically identifying the row and column positioning information of page components and dividing the projection interval, the problem of low recognition accuracy and high labor cost in the existing technology is solved, and high-accuracy component layout recognition is achieved.

CN118733028APending Publication Date: 2024-10-01TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310331987.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, identifying the layout of page components has low accuracy and requires a lot of manpower, resulting in heavy workload and high cost.

Method used

Based on the page configuration information of the page to be identified, the row positioning information and column positioning information of the component are determined, the projection interval is divided, and the component layout is automatically identified to avoid manual participation and case library comparison.

Benefits of technology

It realizes automatic recognition of component layout, reduces labor costs, improves recognition accuracy, and avoids recognition errors caused by an incomplete case library.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733028A_ABST
    Figure CN118733028A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Internet, and provides a method and device for identifying a page component layout mode, equipment and a storage medium. The method can be applied to a cloud server, and comprises the following steps: respectively determining position information of each component in a to-be-identified page based on page configuration information of the to-be-identified page; for at least one component, respectively executing the following operations: determining a first projection interval of one component on a first plane according to the row positioning information of one component, and determining a second projection interval of one component on a second plane according to the column positioning information of one component; and obtaining a component layout mode of the at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of the at least one component. The method is used for solving the problems that the accuracy rate is low and a large amount of manpower needs to be consumed when the layout mode of the component is identified in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of the Internet, the Internet has become an important way for people to obtain information resources. The presentation of information resources is inseparable from the important medium of pages. The main function of pages is to organize the information resources needed by the target object by certain means and present them to the target object through the Internet. Among them, pages can include web pages, application pages, and mini-program pages.

[0003] Take web pages as an example. Web pages are usually composed of various components. The types of components have changed greatly with the development of the Internet. In the late 1990s, components usually only included text, tables, hyperlinks and pictures, but now they can also include components with dynamic effects, such as animation, video, music, etc. The display of the above components in web pages is inseparable from the layout between components. In order to make the web page design more beautiful and give the target object a good browsing experience, web designers are usually required to design the component style, component content and component layout method to determine the design draft when developing web pages. The web developers then convert the component layout method in the design draft into the corresponding code to develop the web page. Since different component layout methods can correspond to different programming paradigms, for web developers, each development needs to first determine the component layout method through manual identification, and then write the corresponding code according to the programming paradigm corresponding to the component layout method, which undoubtedly increases the workload. Therefore, how to identify the component layout method is particularly important.

[0004] In view of this, there is an urgent need for a method for identifying the layout mode of page components, which can automatically identify the layout mode of components without human intervention and improve the recognition accuracy. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for identifying the layout of page components to solve the problem of low accuracy and large amount of manpower required when identifying the layout of components in the related art.

[0006] In a first aspect, an embodiment of the present application provides a method for identifying a layout mode of a page component, comprising:

[0007] Based on the page configuration information of the page to be identified, the position information of each component in the page to be identified is determined respectively; the page to be identified includes at least one component, and the position information of each component includes: the row positioning information and column positioning information of the corresponding component in the page to be identified; for the at least one component, the following operations are performed respectively: according to the row positioning information of a component, a first projection interval of the component on a first plane is determined, and according to the column positioning information of the component, a second projection interval of the component on a second plane is determined; the first plane is perpendicular to the second plane; according to the first projection interval and the second projection interval of each of the at least one component, a component layout mode of the at least one component included in the page to be identified is obtained.

[0008] In a second aspect, an embodiment of the present application further provides a device for identifying a layout mode of a page component, including:

[0009] A first processing unit is used to determine the position information of each component in the page to be identified based on the page configuration information of the page to be identified; the page to be identified includes at least one component, and the position information of each component includes: row positioning information and column positioning information of the corresponding component in the page to be identified;

[0010] The second processing unit is configured to respectively perform the following operations for the at least one component: determine a first projection interval of the component on a first plane according to row positioning information of the component, and determine a second projection interval of the component on a second plane according to column positioning information of the component; the first plane is perpendicular to the second plane;

[0011] The third processing unit is used to obtain a component layout mode of the at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of each of the at least one component.

[0012] In a possible implementation, the row positioning information of each component includes the second direction coordinates of each component on the page and the height of each component, and the second direction is perpendicular to the first plane; then, when the second processing unit determines the first projection interval of a component on the first plane based on the row positioning information of a component, it is used to: determine the starting position of the first projection interval corresponding to the component based on the second direction coordinates of the component, and determine the length of the first projection interval corresponding to the component based on the height of the component; determine the end position of the first projection interval based on the starting position and the length.

[0013] In one possible implementation, when the third processing unit determines the row layout of the at least one component included in the page to be identified based on the first projection interval of each of the at least one component, it is used to: divide the obtained at least one first projection interval into N first groups according to the starting position and the ending position of the first projection interval of each of the at least one component, where N is a positive integer; wherein, if a first group includes at least two first projection intervals, then there is an inclusion relationship or an intersection relationship between the at least two first projection intervals; and based on the value of N, determine the row layout of the at least one component included in the page to be identified.

[0014] In a possible implementation, before the third processing unit divides the obtained at least one first projection interval into N first groups, it is also used to: based on the starting position and the ending position of the first projection interval of each of the at least one component, when there is an overlapping interval between the two first projection intervals, determine whether the two first projection intervals have an inclusion relationship or an intersection relationship.

[0015] In a possible implementation, the column positioning information of each component includes the first direction coordinates of each component and the width of each component, and the first direction is perpendicular to the second plane; then, when the second processing unit determines the second projection interval of the component on the second plane based on the column positioning information of the component, it is used to: determine the starting position of the second projection interval corresponding to the component according to the first direction coordinates of the component, and determine the length of the second projection interval corresponding to the component according to the width of the component; determine the end position of the second projection interval according to the starting position and the length.

[0016] In a possible implementation, when the third processing unit determines the column layout of the at least one component included in the page to be identified according to the respective second projection intervals of the at least one component, it is used to: divide the obtained at least one second projection interval into M second groups according to the starting position and the ending position of the respective second projection intervals of the at least one component, where M is a positive integer; wherein, if a second group includes at least two second projection intervals, then there is an inclusion relationship or an intersection relationship between the at least two second projection intervals; and based on the value of M, determine the column layout of the at least one component included in the page to be identified.

[0017] In a possible implementation, before the third processing unit divides the obtained at least one second projection interval into M second groups, it is also used to: based on the starting position and the ending position of the second projection interval of each of the at least one component, when there is an overlapping interval between the two second projection intervals, determine whether the two second projection intervals have an inclusion relationship or an intersection relationship.

[0018] In a possible implementation, when the first processing unit determines the position information of each component in the page to be identified based on the page configuration information of the page to be identified, it is used to: for the at least one component, perform the following operations respectively: determine the longest distance occupied by a component in the first direction and the second direction respectively according to the occupied area of ​​the component in the page to be identified in the page configuration information; determine the circumscribed rectangle of the component according to the longest distance occupied by the component in the first direction and the second direction respectively, and use the position information of the circumscribed rectangle as the position information of the component; the adjacent sides of the circumscribed rectangle are parallel to the first direction and the second direction respectively.

[0019] In a third aspect, an embodiment of the present application further provides a computer device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the above-mentioned methods for identifying the layout of page components.

[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute any step of the above-mentioned method for identifying the layout of page components.

[0021] In a fifth aspect, an embodiment of the present application further provides a computer program product, including computer instructions, which are executed by a processor to perform the steps of any of the above-mentioned methods for identifying the layout of page components.

[0022] The beneficial effects of this application are as follows:

[0023] The embodiment of the present application provides a method, device, equipment and storage medium for identifying the layout mode of page components. The method determines the row positioning information and column positioning information of at least one component included in the page to be identified through the page configuration information of the page to be identified. For each component in the at least one component, a first projection interval of the component can be obtained by orthographic projection on the first plane according to the row positioning information of the component. A second projection interval of the component can be obtained by orthographic projection on the second plane according to the column positioning information of the component. Thus, the component can be converted from a two-dimensional graphic in the page into a one-dimensional interval in the first direction and a one-dimensional interval in the second direction respectively. Then, the component layout mode of at least one component included in the page to be identified is obtained according to the first projection interval and the second projection interval of at least one component. When identifying the component layout mode by the above method, it can be automatically identified without manual participation, so the labor cost can be reduced. And since there is no need to compare with the layout mode case in the case library, there is no recognition error caused by not including the corresponding layout mode case in the case library, so the recognition accuracy can be improved compared with the related art.

[0024] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0026] Figure 1 A schematic diagram of the component layout provided in an embodiment of the present application;

[0027] Figure 2 This is an optional schematic diagram of an application scenario in an embodiment of the present application;

[0028] Figure 3 An exemplary flow chart of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0029] Figure 4A The embodiment of the present application provides a schematic diagram of a method for determining a circumscribed rectangle of a component;

[0030] Figure 4B A schematic diagram of the position information of the circumscribed rectangle provided in an embodiment of the present application;

[0031] Figure 5AA schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0032] Figure 5B A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0033] Figure 5C A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0034] Fig. 6A A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0035] Figure 6B A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0036] Figure 6C A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0037] Fig.6D A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0038] Fig. 7A A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0039] Figure 7B A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0040] Figure 7C A schematic diagram of a method for identifying a layout mode of page components provided in an embodiment of the present application;

[0041] Figure 8 A schematic diagram of the structure of a device for identifying a layout mode of page components provided in an embodiment of the present application;

[0042] Fig. 9 A schematic diagram of a hardware structure of a computer device to which an embodiment of the present application is applied;

[0043] Fig.10 A schematic diagram of the hardware composition structure of another computer device to which the embodiment of the present application is applied. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0045] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0046] Components: The text, tables, hyperlinks, pictures, animations, videos, music and other parts on the page can be collectively referred to as components.

[0047] Page layout: refers to planning the placement of components on the page, summarizing and distinguishing components according to primary and secondary content, and then improving the browsing experience of the target object by arranging components including pictures, texts and other contents in a way that is most suitable for browsing according to certain principles. Page layout is an important part of page optimization and affects the overall appearance of the page to a certain extent. For example, for a web page, page layout can refer to different page layouts formed by placing search box components and components including pictures and texts in different positions.

[0048] Component layout mode: The component layout mode in the embodiment of the present application refers to the arrangement of at least one component added to the page in rows and columns when performing page layout. The row layout mode refers to the number of rows of at least one component, and the column layout mode refers to the number of columns of at least one component. For example, Figure 1 As shown, page 100 includes three components: component A, component B and component C, and these three components are arranged in a row and three columns. The layout of the components in page 100 is one row and three columns, the row layout is 1 row, and the column layout is 3 columns. Page 100 may refer to a web page, an application page, a mini-program page, or other pages.

[0049] The following is a brief introduction to the design concept of the embodiment of the present application:

[0050] When developing a page, it is usually necessary for the page designer to determine the components that need to be included in the page and the layout of the components and obtain a design draft. The page developer then develops the page by converting the component layout in the design draft into code according to the corresponding programming paradigm.

[0051] In the related art, a machine learning method is usually used to identify component layouts. In this method, a large number of layout cases need to be collected before identifying the component layout, and then the layout of each layout case is determined by manual marking, and the marked layout cases are stored in the case library to establish a case library. When identifying the component layout, the layout to be identified is compared with the layout cases stored in the case library, and then the layout to be identified is determined based on the comparison results. However, the recognition accuracy of this method is mainly based on a large number of layout cases, but the component layout methods are diverse and ever-changing, and it is impossible to enumerate all situations. Therefore, there may be errors when identifying the component layout by this method; and because each layout case needs to be manually marked, a large amount of manpower costs are still required when the layout cases are large.

[0052] In view of this, the embodiment of the present application provides a method, device, equipment and storage medium for identifying the layout mode of page components. In the method, the row positioning information and column positioning information of at least one component included in the page to be identified are determined by the page configuration information of the page to be identified. For each component in the at least one component, a first projection interval of the component can be obtained by orthographic projection on the first plane according to the row positioning information of the component. A second projection interval of the component can be obtained by orthographic projection on the second plane according to the column positioning information of the component. Thus, the component can be converted from a two-dimensional graphic in the page into a one-dimensional interval in the first direction and a one-dimensional interval in the second direction respectively. Then, the component layout mode of at least one component included in the page to be identified is obtained according to the first projection interval and the second projection interval of at least one component. When identifying the component layout mode by the above method, it can be automatically identified without manual participation, so the labor cost can be reduced. And since there is no need to compare with the layout mode case in the case library, there is no recognition error caused by not including the corresponding layout mode case in the case library, so the recognition accuracy can be improved compared with the related art.

[0053] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0054] Figure 2 One application scenario is shown, including two terminal devices 210 and a server 220, each terminal device 210 establishes a communication connection with the server 220 through a wired network or a wireless network. The terminal device 210 in the embodiment of the present application can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.

[0055] The server 220 of the embodiment of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. This application does not make any restrictions here.

[0056] It should be noted that the method for identifying the layout mode of page components in the embodiment of the present application can be executed by a computer device, which can be a server 220 or a terminal device 210, that is, the method can be executed by the server 220 or the terminal device 210 alone, or by the server 220 and the terminal device 210 together. For example, when executed by two terminal devices 210 and the server 220 together, one of the terminal devices 210 can send the page configuration information of the page to be identified to the server 220. The server 220 receives the page configuration information of the page to be identified sent by the terminal device 210, and determines the position information of each component in the page to be identified according to the page configuration information. And for each component in at least one component, determine the first projection interval of the component on the first plane according to the row positioning information of the component, and determine the second projection interval of the component on the second plane according to the column positioning information of the component. The server 220 can also obtain the component layout mode of at least one component included in the page to be identified according to the first projection interval and the second projection interval of the at least one component. Then return the component layout mode to another terminal device 210.

[0057] It should be noted that Figure 2 What is shown is just an example. In fact, the number and communication mode of terminal devices and servers are not limited and are not specifically limited in the embodiments of the present application.

[0058] In addition, the method for identifying the layout mode of page components provided in the embodiments of the present application can at least be applied to scenarios such as identifying the layout mode of web page components, identifying the layout mode of application components, and identifying the layout mode of mini-program components, and the present application does not limit this.

[0059] The following describes a method for identifying the layout of page components provided by an exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.

[0060] See also Figure 3As shown, it is a flow chart of the method for identifying the layout mode of page components provided in the embodiment of the present application. Here, an example is given with a server as the execution subject. The specific implementation process of the method is as follows:

[0061] Step 301: Based on the page configuration information of the page to be identified, the location information of each component in the page to be identified is determined respectively.

[0062] The position information of each component may include: row positioning information and column positioning information of the corresponding component in the page to be identified. The row positioning information may include the second direction coordinates and height of the corresponding component, and the column positioning information may include the first direction coordinates and width of the corresponding component. The first direction is perpendicular to the second direction, for example, the first direction may be the horizontal axis direction of the page, and the second direction may be the vertical axis direction of the page.

[0063] Since the shapes of most components are usually irregular, in order to simplify the calculation, the occupied area of ​​each component can be represented by the occupied area of ​​the circumscribed rectangle through the Axis-Aligned Bounding Box (AABB), so that the position information of the circumscribed rectangle is used as the position information of the corresponding component.

[0064] Specifically, when determining the position information of each component, the following operations may be performed for each component in at least one component: according to the occupied area of ​​a component on the page to be identified in the page configuration information, the longest distance occupied by a component in the first direction and the second direction may be determined. Then, according to the longest distance occupied by the component in the first direction and the second direction, the bounding rectangle of the component may be determined, and the position information of the bounding rectangle may be used as the position information of the component. The adjacent sides of the bounding rectangle are parallel to the first direction and the second direction, respectively.

[0065] For example, in the scenario of identifying the layout of web page components, Figure 4A As shown, the page to be identified includes component D, the first direction is the X axis, and the second direction is the Y axis. For component D, the longest distance occupied in the X axis direction is the length of line segment cd, and the longest distance occupied in the Y axis direction is the length of line segment ab, then the length of cd can be used as the length, the length of ab can be used as the width, and the adjacent two sides are made parallel to the X axis and the Y axis respectively, so as to determine the circumscribed rectangle D, and the position information of the circumscribed rectangle D is used as the position information of component D.

[0066] Based on the above method, each component in the page to be identified can be simplified into a regular rectangle, which can reduce the amount of calculation on the server and improve the recognition efficiency of the component layout.

[0067] In a possible implementation, for each bounding rectangle of at least one component, the position information of the bounding rectangle includes row positioning information and column positioning information of the bounding rectangle. Among them, the second direction coordinate in the row positioning information of the bounding rectangle and the first direction coordinate in the column positioning information are the first direction coordinate and the second direction coordinate of the same vertex. In the embodiment of the present application, the second direction coordinate in the row positioning information can be the second direction coordinate of the upper right vertex of the bounding rectangle, and the first direction coordinate in the column positioning information can be the first direction coordinate of the upper right vertex of the bounding rectangle.

[0068] See also Figure 4B A schematic diagram of the location information of the circumscribed rectangle provided in an embodiment of the present application. In the scenario of identifying the layout mode of a web page component, Figure 4B The circumscribed rectangle D shown is Figure 4A The upper right vertex of the bounding rectangle D is vertex A. The position information of the bounding rectangle D includes: the X-axis coordinate of vertex A is x A , the Y-axis coordinate of vertex A is y A The width of the circumscribed rectangle D is width and the height is height. Among them, height is equal to Figure 4A The length of the midline segment ab, width is equal to Figure 4A The length of the midline segment cd. Based on the above position information, the coordinates of the other vertices of the circumscribed rectangle can be determined. For example, the lower left vertex of the circumscribed rectangle D is vertex B, and the coordinates of vertex B are (x A -width,y A -height). The coordinates of the upper left vertex are (x A -width,y A ), the coordinates of the lower right vertex are (x A ,y A -height).

[0069] It should be noted that the second direction coordinates in the row positioning information of the bounding rectangle and the first direction coordinates in the column positioning information can also be the first direction coordinates and the second direction coordinates of other vertices. For example, the second direction coordinates in the row positioning information of the bounding rectangle and the first direction coordinates in the column positioning information can be the first direction coordinates and the second direction coordinates of the lower left vertex, or can be the first direction coordinates and the second direction coordinates of the lower right vertex, or can be the first direction coordinates and the second direction coordinates of the upper left vertex, and this application does not limit this.

[0070] Step 302: for at least one component, perform the following operations respectively: determine a first projection interval of a component on a first plane according to row positioning information of a component, and determine a second projection interval of a component on a second plane according to column positioning information of a component.

[0071] The first plane is a plane perpendicular to the first direction, and the second plane is a plane perpendicular to the second direction. For example, when the first direction is the horizontal axis of the page and the second direction is the vertical axis of the page, the first plane is a plane perpendicular to the horizontal axis of the page, and the second plane is a plane perpendicular to the vertical axis of the page.

[0072] It should be noted that the components appearing in the drawings in the following description are represented by the occupied areas of the circumscribed rectangles corresponding to the components, which will not be described in detail below.

[0073] In one example, in the scenario of identifying the layout of a web page component, such as Figure 5A As shown, the page to be identified includes component E and component F. The first direction can be the X-axis, and the second direction can be the Y-axis. Assume that the first plane is the plane where the Y-axis is located and perpendicular to the X-axis, and the second plane is the plane where the X-axis is located and perpendicular to the Y-axis. Then, component E is projected onto the first plane, and the first projection interval is determined to be the interval [e, f]. Component F is projected onto the first plane, and the first projection interval is also determined to be the interval [e, f]. Component E is projected onto the second plane, and the second projection interval is determined to be the interval [g, h]. Component F is projected onto the second plane, and the second projection interval is also determined to be the interval [i, j].

[0074] In some embodiments, for each component in at least one component, when the server determines the first projection interval of the component on the first plane according to the positioning information of a component row, the server can determine the starting position of the first projection interval corresponding to the component according to the second direction coordinate of the component. The length of the first projection interval corresponding to the component can also be determined according to the height of the component. Thus, the end position of the first projection interval is determined according to the starting position and the length.

[0075] In one example, in the scenario of identifying the layout of a web page component, such as Figure 5B As shown, the first direction may be the X axis, and the second direction may be the Y axis. Assume that the first plane is a plane where the Y axis is located and is perpendicular to the X axis, and the second plane is a plane where the X axis is located and is perpendicular to the Y axis. For component E, the row positioning information of component E may include that the Y axis coordinate of vertex C is y C , the height of component E is height. Among them, the Y-axis coordinate of component E is the Y-axis coordinate of vertex C. According to the Y-axis coordinate of vertex C, we can determine f=y C According to the height of component E, the length of interval [e, f] can be determined as height, thus determining the end position of interval [e, f] e = y C Similarly, for component F, f=y can be determined based on the Y-axis coordinate of vertex D. C, according to the height of component F, the length of interval [e, f] can be determined as height, thus determining the end position of interval [e, f] e = y C -height.

[0076] Based on the above scheme, the first projection interval of the component can be determined according to the row positioning information of each component, so as to convert the component from two dimensions to one dimension to identify the column layout of at least one component included in the page to be identified. Since there is no need to compare the layout cases in the case library when identifying the component layout through this method, there is no case blind spot, so it is possible to achieve full-scale and full-layout identification and improve the recognition accuracy. And since there is no need to collect layout cases and establish a case library, it can also greatly reduce labor costs and equipment costs compared to related technologies.

[0077] In some embodiments, for each component in at least one component, when determining the second projection interval of the component on the second plane according to the column positioning information of a component, the server may determine the starting position of the second projection interval corresponding to the component according to the first direction coordinate of the component, and determine the length of the second projection interval corresponding to the component according to the width of the component. The ending position of the second projection interval is determined according to the starting position and the length.

[0078] In one example, in the scenario of identifying the layout of a web page component, such as Figure 5B As shown, for component E, the column positioning information of component E may include the X-axis coordinate of vertex C as x C , the width of component E is width. Among them, the X-axis coordinate of component E is the X-axis coordinate of vertex C. According to the X-axis coordinate of vertex C, h=x C According to the width of component E, the length of interval [g, h] can be determined as width, thus determining the end position of interval [g, h] g = x C Similarly, for component F, j=x can be determined based on the X-axis coordinate of vertex D. D According to the width of component F, the length of interval [i, j] can be determined as width, thus determining the end position i=x of interval [i, j]. D -width.

[0079] Based on the above method, the second projection interval of the component can be determined according to the column positioning information of each component, so as to convert the component from two dimensions to one dimension to identify the row layout of at least one component included in the page to be identified. Since the method does not need to compare with the layout cases in the case library when identifying the component layout, there is no case blind spot, so it can achieve full-faceted and full-layout identification and improve the identification accuracy. And since there is no need to collect layout cases and establish a case library, it can also greatly reduce labor costs and equipment costs compared with related technologies.

[0080] In one example, in the scenario of identifying the layout of a web page component, such as Figure 5C As shown, the first direction can be the X-axis, and the second direction can be the Y-axis. Assume that the first plane is the plane where the Y-axis is located and is perpendicular to the X-axis, and the second plane is the plane where the X-axis is located and is perpendicular to the Y-axis. The coordinates of component E are (70,60), and the coordinates of component F are (150,60), and the widths of components E and F are both 60, and the heights are both 40, and the units are both mm. At this time, according to the above method, it can be determined that the first projection intervals corresponding to components E and F are both [20,60]. The second projection interval corresponding to component E is [10,70], and the second projection interval corresponding to component F is [90,150]. For specific steps, please refer to the relevant description of the above method embodiment, which will not be repeated here.

[0081] Step 303: Obtaining a component layout mode of at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of at least one component.

[0082] In a possible implementation, the server may determine a row layout of at least one component included in the to-be-identified page according to the first projection interval of at least one component, determine a column layout of at least one component included in the to-be-identified page according to the second projection interval of at least one component, and obtain a component layout according to the row layout and the column layout.

[0083] Based on the above method, the layout mode of components can be identified in real time by calculating the row layout mode and the column layout mode separately, thereby avoiding the problem of identification errors when there are no relevant layout mode cases in the case library in the related technology, and improving the recognition accuracy. In addition, since there is no need to collect layout mode cases and establish a case library, the labor cost and equipment cost can be greatly reduced compared with the related technology.

[0084] In some embodiments, when the server determines the row layout of at least one component included in the page to be identified according to the first projection interval of at least one component, the server can divide the obtained at least one first projection interval into N first groups according to the starting position and the ending position of the first projection interval of at least one component. Where N is a positive integer, if a first group includes at least two first projection intervals, there is an inclusion relationship or an intersection relationship between the at least two first projection intervals. Then, based on the value of N, the row layout of at least one component included in the page to be identified can be determined.

[0085] Specifically, when a component is included in the page to be identified, since the page to be identified does not include the first projection interval that can have an inclusion relationship or an intersection relationship with this component, the value of N can be determined to be 1, and based on the value of N, it can be determined that the row layout of at least one component included in the page to be identified is 1 row.

[0086] In some embodiments, when the page to be identified includes at least two components, the server can determine the existence of an inclusion relationship or an intersection relationship between the two first projection intervals based on the starting position and the ending position of the first projection interval of at least one component, when there is an overlapping interval between the two first projection intervals, and divide the two first projection intervals into the same first group.

[0087] In one example, in the scenario of identifying the layout of a web page component, such as Fig. 6A As shown, the first direction may be the X-axis, and the second direction may be the Y-axis. Assume that the first plane is a plane where the Y-axis is located and is perpendicular to the X-axis, and the second plane is a plane where the X-axis is located and is perpendicular to the Y-axis. The page to be identified includes components G and H. Through the method of step 302, it can be determined that the first projection interval corresponding to component G is the interval [o, l], the starting position is l, and the end position is o. The first projection interval corresponding to component H is the interval [o, n], the starting position is n, and the end position is o. Since the end positions of the first projection interval corresponding to component H and the first projection space corresponding to component G are both o, and l is greater than n, it can be known that the overlap interval between the first projection interval corresponding to component H and the first projection interval corresponding to component G is the interval [o, n]. Therefore, it can be determined that there is an inclusion relationship or an intersection relationship between the first projection interval corresponding to component H and the first projection space corresponding to component G. Because the overlap interval is the full interval of the first projection interval corresponding to component H, it can be determined that there is an inclusion relationship between the first projection interval corresponding to component H and the first projection space corresponding to component G. And the first projection interval corresponding to component H and the first projection space corresponding to component G are divided into the same first group.

[0088] In another example, in the scenario of identifying the layout of web page components, such as Figure 6B As shown, the first direction may be the X-axis, and the second direction may be the Y-axis. Assume that the first plane is a plane where the Y-axis is located and is perpendicular to the X-axis, and the second plane is a plane where the X-axis is located and is perpendicular to the Y-axis. The page to be identified includes components G and components I. Through the method of step 302, it can be determined that the first projection interval corresponding to component G is interval [o, l], the starting position is l, and the end position is o. The first projection interval corresponding to component I is interval [m, k], the starting position is k, and the end position is m. Since k is greater than l and m is greater than o, that is, the starting position of the first projection interval corresponding to component I is greater than the starting position of the first projection interval corresponding to component G; and the ending position of the first projection interval corresponding to component I is greater than the ending position of the first projection interval corresponding to component G; but m is less than l, that is, the ending position of the first projection interval corresponding to component I is less than the starting position of the first projection interval corresponding to component G, it can be known that the overlap interval between the first projection interval corresponding to component I and the first projection space corresponding to component G is the interval [m, l], so it can be determined that there is an inclusion relationship or an intersection relationship between the first projection interval corresponding to component I and the first projection space corresponding to component G. Because the overlap interval is neither the full interval of the first projection interval corresponding to component I nor the full interval of the first projection interval corresponding to component G, it can be determined that there is an intersection relationship between the first projection interval corresponding to component I and the first projection space corresponding to component G. And the first projection interval corresponding to component I and the first projection space corresponding to component G are divided into the same first group.

[0089] In yet another example, in the scenario of identifying the layout of a web page component, such as Figure 6C As shown, the first direction may be the X-axis, and the second direction may be the Y-axis. Assume that the first plane is the plane where the Y-axis is located and is perpendicular to the X-axis, and the second plane is the plane where the X-axis is located and is perpendicular to the Y-axis. The page to be identified includes components G, H, I, and J. Through the method of step 302, it can be determined that the first projection interval corresponding to component G is the interval [o, l], with a starting position of l and an end position of o. The first projection interval corresponding to component H is the interval [o, n], with a starting position of n and an end position of o. The first projection interval corresponding to component I is the interval [m, k], with a starting position of k and an end position of m. The first projection interval corresponding to component J is the interval [q, p], with a starting position of p and an end position of q. Through the above Fig. 6A and Figure 6BFrom the relevant description, it can be known that the first projection interval corresponding to component G and the first projection interval corresponding to component H are divided into the same first group, and the first projection interval corresponding to component G and the first projection interval corresponding to component I are divided into the same first group. Therefore, the first projection interval corresponding to component G, the first projection interval corresponding to component H, and the first projection interval corresponding to component I can be divided into the same first group. Since the first projection interval corresponding to component J has no inclusion relationship or intersection relationship with the first projection intervals of other components included in the page to be identified, the first projection interval corresponding to component J can be taken as a first group alone. In summary, 2 first groups can be obtained, that is, the value of N is 2. Based on the value of N, it can be determined that the row layout of the page to be identified is 2 rows.

[0090] Based on the above method, by grouping the first projection intervals, components belonging to the same row can be easily distinguished, so that the row layout of the page to be identified is determined according to the number of the first groups, thereby improving the recognition accuracy.

[0091] In a possible implementation, when there is an intersection relationship between the two first projection intervals, the ratio of the length of the intersection interval to the length of each of the two first projection intervals can be determined to obtain two ratios. If at least one of the two ratios is greater than a preset ratio threshold, the two first projection intervals can be divided into the same first group. If both ratios are less than the preset ratio threshold, the two first projection intervals can be divided into two first groups respectively. That is, it is determined that the components corresponding to the two first projection intervals do not belong to the same row.

[0092] For example, Figure 6B For example, component I and component G have an intersection relationship, and interval [m, l] is the intersection interval between the first projection interval corresponding to component G and the first projection interval corresponding to component I. Assuming that the ratio of the length of interval [m, l] to the length of interval [m, k] is 20%, the ratio of the length of interval [m, l] to the length of interval [m, k] is 5%, and the preset ratio threshold is 10%, since the ratio of the length of interval [m, l] to the length of interval [m, k] is greater than the preset ratio threshold, the first projection interval corresponding to component I and the first projection interval corresponding to component G can be divided into the same first group.

[0093] It should be noted that the preset ratio threshold can be set according to actual conditions or experience, and this application does not limit this.

[0094] In some embodiments, when the server determines the row layout of at least one component included in the page to be identified according to the second projection interval of at least one component, the server can divide the obtained at least one second projection interval into M second groups according to the starting position and the ending position of the second projection interval of at least one component. Wherein, M is a positive integer, and if a second group includes at least two second projection intervals, there is an inclusion relationship or an intersection relationship between the at least two second projection intervals. Then, based on the value of M, the column layout of at least one component included in the page to be identified can be determined.

[0095] Specifically, when a component is included in the page to be identified, since the page to be identified does not include a second projection interval that can have an inclusion relationship or an intersection relationship with this component, the value of M can be determined to be 1, and based on the value of M, it can be determined that the column layout of at least one component included in the page to be identified is 1 column.

[0096] In some embodiments, when the page to be identified includes at least two components, the server can determine the existence of an inclusion relationship or an intersection relationship between the two second projection intervals based on the starting position and the ending position of the second projection interval of at least one component, when there is an overlapping interval between the two second projection intervals, and divide the two second projection intervals into the same second group.

[0097] by Figure 6C Take the component layout shown in the figure as an example. Fig.6D As shown, through the method of step 302, it can be determined that the second projection interval corresponding to component G and the second projection interval corresponding to component J are both intervals [r, s], with a starting position of s and an ending position of r. The second projection interval corresponding to component H is interval [t, u], with a starting position of u and an ending position of t. The second projection interval corresponding to component I is interval [w, v], with a starting position of v and an ending position of w. Since the second projection interval corresponding to component G and the second projection interval corresponding to component J are the same, it can be determined that there is an inclusion relationship between the two second projection intervals, and the two second projection intervals are divided into the same second group. If the second projection space corresponding to component H does not have an inclusion relationship or an intersection relationship with the second projection intervals corresponding to other components in the page to be identified, the second projection interval corresponding to component H is separately divided into a second group. Similarly, the second projection space corresponding to component I can also be separately divided into a second group. Therefore, the value of M is 3, and based on the value of M, it can be determined that the column layout of at least one component included in the page to be identified is 3 columns.

[0098] According to the row layout and column layout of the page to be identified, it can be determined Figure 6C and Fig.6DThe components are laid out in 1 row and 3 columns.

[0099] Based on the above method, by grouping the second projection intervals, components belonging to the same column can be easily distinguished, so that the column layout of the page to be identified is determined according to the number of second groups, thereby improving the recognition accuracy.

[0100] In a possible implementation, when there is an intersection relationship between the two second projection intervals, the ratio of the length of the intersection interval to the length of each of the two second projection intervals can be determined to obtain two ratios. If at least one of the two ratios is greater than a preset ratio threshold, the two second projection intervals can be divided into the same second group. If both ratios are less than the preset ratio threshold, the two second projection intervals can be divided into two second groups. That is, it is determined that the components corresponding to the two second projection intervals do not belong to the same column.

[0101] It should be noted that the method for determining whether there is an inclusion relationship or an intersection relationship between two second projection intervals is the same as the method for determining whether there is an inclusion relationship or an intersection relationship between two first projection intervals, and the method for determining the column layout mode is also the same as the method for determining the row layout mode, which can be seen in FIG. Figure 6A-6C The relevant description in the illustrated embodiment will not be repeated here.

[0102] By using the method for identifying the layout mode of page components as shown in step 301 to step 303, automatic identification of component layout modes can be achieved. Since no human intervention is required in the identification process, labor costs can be reduced. In addition, since this method does not identify by comparing with layout mode cases in the case library, there is no identification error caused by the case library not including the corresponding layout mode cases. Therefore, compared with the related art, the identification accuracy can be improved.

[0103] Below, in order to more clearly understand the solution proposed in the embodiment of the present application, a method for identifying the layout of page components provided by the present application will be introduced in combination with a specific embodiment.

[0104] In one example, in a scenario where the layout of a web page component is identified, and in Figure 7A-7C The first direction may be the X axis, and the second direction may be the Y axis. Assume that the first plane is a plane where the Y axis is located and is perpendicular to the X axis, and the second plane is a plane where the X axis is located and is perpendicular to the Y axis.

[0105] like Fig. 7AAs shown, the page to be identified includes: picture component 1, picture component 2, audio component, text component and video component. Among them, the position information of picture component 1 includes: the width of picture component 1 is 34, the height is 22, and the upper right vertex coordinate is (64,80). The position information of picture component 2 includes: the width of picture component 2 is 34, the height is 22, and the upper right vertex coordinate is (112,80). The position information of the audio component includes: the width of the audio component is 82, the height is 12, and the upper right vertex coordinate is (112,59). The position information of the text component includes: the width of the audio component is 82, the height is 12, and the upper right vertex coordinate is (112,44). The position information of the video component includes: the width of the text component is 82, the height is 18, and the upper right vertex coordinate is (112,28). Among them, the above units are all mm.

[0106] like Figure 7B As shown, each component included in the page to be identified is projected onto the first plane to obtain a first projection interval corresponding to each component. Fig. 7A From the heights and Y-axis coordinates of each component shown, it can be determined that the first projection intervals corresponding to image component 1 and image component 2 are both (62, 80). Since the first projection intervals corresponding to image component 1 and image component 2 are the same, it can be determined that the two first projection intervals have an inclusion relationship and are divided into the same first group. The first projection interval corresponding to the audio component is (47, 59). The first projection interval corresponding to the text component is (32, 44). The first projection interval corresponding to the video component is (10, 28). Since the first projection intervals corresponding to the audio component, the text component, and the video component do not have an inclusion relationship or an intersection relationship with other first projection intervals, the first projection intervals corresponding to the audio component, the text component, and the video component can be divided into a first group respectively. It can be seen that the value of N is 4, and according to the value of N, it can be determined that the row layout of at least one component included in the page to be identified is 4 rows.

[0107] like Figure 7C As shown, each component included in the page to be identified is projected onto a plane where the X-axis is located and perpendicular to the Y-axis to obtain a second projection interval corresponding to each component. Fig. 7AFrom the width and X-axis coordinates of each component shown, it can be determined that the second projection interval corresponding to the picture component 1 is (30, 64). The second projection interval of the picture component 2 is (78, 112). The second projection intervals corresponding to the audio component, the text component, and the video component are all (30, 112). Since the second projection intervals corresponding to the audio component, the text component, and the video component are the same, and the second projection interval corresponding to the picture component 1 is contained in the second projection interval corresponding to the audio component, and the second projection interval corresponding to the picture component 2 is also contained in the second projection interval corresponding to the audio component, the second projection intervals corresponding to the picture component 1, the picture component 2 audio component, the text component, and the video component can be divided into the same second group. It can be seen that the value of M is 1, and according to the value of M, it can be determined that the column layout of at least one component included in the page to be identified is 1 column.

[0108] According to the row layout and column layout of the page to be identified, it can be determined as follows Figure 7A-7C The components are shown arranged in 4 rows and 1 column.

[0109] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a device for identifying the layout mode of page components. Figure 8 The apparatus 800 for identifying a layout mode of a page component may include:

[0110] The first processing unit 801 is used to determine the position information of each component in the page to be identified based on the page configuration information of the page to be identified; the page to be identified includes at least one component, and the position information of each component includes: row positioning information and column positioning information of the corresponding component in the page to be identified;

[0111] The second processing unit 802 is configured to perform the following operations for the at least one component: determine a first projection interval of the component on a first plane according to row positioning information of the component, and determine a second projection interval of the component on a second plane according to column positioning information of the component; the first plane is perpendicular to the second plane;

[0112] The third processing unit 803 is used to obtain a component layout mode of the at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of each of the at least one component.

[0113] In a possible implementation, when the third processing unit 803 obtains the component layout mode of the at least one component included in the page to be identified according to the first projection interval and the second projection interval of each of the at least one component, it is used to: determine the row layout mode of the at least one component included in the page to be identified according to the first projection interval of each of the at least one component; determine the column layout mode of the at least one component included in the page to be identified according to the second projection interval of each of the at least one component; and obtain the component layout mode according to the row layout mode and the column layout mode.

[0114] In a possible implementation, the row positioning information of each component includes the second direction coordinates of each component and the height of each component, and the second direction is perpendicular to the first plane; then, when the second processing unit 802 determines the first projection interval of a component on the first plane based on the row positioning information of a component, it is used to: determine the starting position of the first projection interval corresponding to the component based on the second direction coordinates of the component, and determine the length of the first projection interval corresponding to the component based on the height of the component; determine the end position of the first projection interval based on the starting position and the length.

[0115] In a possible implementation, when the third processing unit 803 determines the row layout of the at least one component included in the page to be identified according to the first projection interval of each of the at least one component, it is used to: divide the obtained at least one first projection interval into N first groups according to the starting position and the ending position of the first projection interval of each of the at least one component, where N is a positive integer; wherein, if a first group includes at least two first projection intervals, then there is an inclusion relationship or an intersection relationship between the at least two first projection intervals; and based on the value of N, determine the row layout of the at least one component included in the page to be identified.

[0116] In a possible implementation, before the third processing unit 803 divides the obtained at least one first projection interval into N first groups, it is also used to: based on the starting position and the ending position of the first projection interval of each of the at least one component, when there is an overlapping interval between the two first projection intervals, determine whether the two first projection intervals have an inclusion relationship or an intersection relationship.

[0117] In a possible implementation, the column positioning information of each component includes the first direction coordinates of each component and the width of each component, and the first direction is perpendicular to the second plane; then, when the second processing unit 802 determines the second projection interval of the component on the second plane based on the column positioning information of the component, it is used to: determine the starting position of the second projection interval corresponding to the component according to the first direction coordinates of the component, and determine the length of the second projection interval corresponding to the component according to the width of the component; determine the end position of the second projection interval according to the starting position and the length.

[0118] In a possible implementation, when the third processing unit 803 determines the column layout of the at least one component included in the page to be identified according to the second projection interval of each of the at least one component, it is used to: divide the obtained at least one second projection interval into M second groups according to the starting position and the ending position of the second projection interval of each of the at least one component, where M is a positive integer; wherein, if a second group includes at least two second projection intervals, then there is an inclusion relationship or an intersection relationship between the at least two second projection intervals; and based on the value of M, determine the column layout of the at least one component included in the page to be identified.

[0119] In a possible implementation, before the third processing unit 803 divides the obtained at least one second projection interval into M second groups, it is also used to: based on the starting position and the ending position of the second projection interval of each of the at least one component, when there is an overlapping interval between the two second projection intervals, determine whether the two second projection intervals have an inclusion relationship or an intersection relationship.

[0120] In a possible implementation, when the first processing unit 801 determines the position information of each component in the page to be identified based on the page configuration information of the page to be identified, it is used to: for the at least one component, perform the following operations respectively: determine the longest distance occupied by the component in the first direction and the second direction respectively according to the occupied area of ​​the component in the page to be identified in the page configuration information; determine the circumscribed rectangle of the component according to the longest distance occupied by the component in the first direction and the second direction respectively, and use the position information of the circumscribed rectangle as the position information of the component; the adjacent sides of the circumscribed rectangle are parallel to the first direction and the second direction respectively.

[0121] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0122] After introducing the method and apparatus for identifying the layout of page components according to an exemplary embodiment of the present application, next, a computer device according to another exemplary embodiment of the present application is introduced.

[0123] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0124] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a computer device. In one embodiment, the computer device may be a server, such as Figure 2 In this embodiment, the structure of the computer device is as follows: Fig. 9 As shown, it may include at least a memory 901 , a communication module 903 , and at least one processor 902 .

[0125] The memory 901 is used to store computer programs executed by the processor 902. The memory 901 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0126] The memory 901 may be a volatile memory, such as a random-access memory (RAM); the memory 901 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 901 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 901 may be a combination of the above memories.

[0127] The processor 902 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 902 is used to implement the above method for identifying the layout mode of page components when calling the computer program stored in the memory 901 .

[0128] The communication module 903 is used to communicate with terminal devices and other servers.

[0129] The specific connection medium between the memory 901, the communication module 903 and the processor 902 is not limited in the embodiment of the present application. Fig. 9 In the embodiment, the memory 901 and the processor 902 are connected via a bus 904. The bus 904 is connected to the processor 902 via a bus 904. Fig. 9 The connections between the other components are only for illustration and are not intended to be limiting. The bus 904 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig. 9 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0130] The memory 901 stores a computer storage medium, which stores computer executable instructions for implementing the method for identifying the layout of page components in the embodiment of the present application. The processor 902 is used to execute the above method for identifying the layout of page components.

[0131] In another embodiment, the computer device may also be other computer devices, such as Figure 2 The terminal device 210 shown in FIG. 1 is a terminal device 210 shown in FIG. 1 . In this embodiment, the structure of the computer device can be as follows: Fig.10 As shown, it includes: a communication component 1010, a memory 1020, a display unit 1030, a camera 1040, a sensor 1050, an audio circuit 1060, a Bluetooth module 1070, a processor 1080 and other components.

[0132] The communication component 1010 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the object to send and receive information through the WiFi module.

[0133] The memory 1020 can be used to store software programs and data. The processor 1080 executes various functions and data processing of the terminal device 210 by running the software programs or data stored in the memory 1020. The memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 1020 stores an operating system that enables the terminal device 210 to run. In the present application, the memory 1020 can store an operating system and various application programs, and can also store a computer program that executes the method for identifying the layout mode of page components in the embodiment of the present application.

[0134] The display unit 1030 can also be used to display information input by the object or information provided to the object and a graphical user interface (GUI) of various menus of the terminal device 210. Specifically, the display unit 1030 may include a display screen 1032 disposed on the front of the terminal device 210. The display screen 1032 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 1030 may be used to display a defect detection interface, a model training interface, etc. in the embodiment of the present application.

[0135] The display unit 1030 can also be used to receive input digital or character information and generate signal input related to the object setting and function control of the terminal device 210. Specifically, the display unit 1030 may include a touch screen 1031 arranged on the front of the terminal device 210, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.

[0136] The touch screen 1031 can be covered on the display screen 1032, or the touch screen 1031 and the display screen 1032 can be integrated to realize the input and output functions of the terminal device 210, and the integrated touch screen can be referred to as a touch display screen. In this application, the display unit 1040 can display the application and the corresponding operation steps.

[0137] The camera 1040 can be used to capture static images, and the object can publish the image taken by the camera 1040 through the application. The camera 1040 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1080 to convert it into a digital image signal.

[0138] The physical terminal device may also include at least one sensor 1050, such as an acceleration sensor 1051, a distance sensor 1052, a fingerprint sensor 1053, and a temperature sensor 1054. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0139] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the object and the terminal device 210. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, which is converted into a sound signal for output. The terminal device 210 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and then the audio data is output to the communication component 1010 to be sent to, for example, another terminal device 210, or the audio data is output to the memory 1020 for further processing.

[0140] The Bluetooth module 1020 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the physical terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1020 to exchange data.

[0141] The processor 1080 is the control center of the physical terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 1020 and calling data stored in the memory 1020. In some embodiments, the processor 1080 may include one or more processing units; the processor 1080 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1080. In the present application, the processor 1080 can run the operating system, application programs, user interface display and touch response, as well as the method for identifying the layout mode of page components in the embodiment of the present application. In addition, the processor 1080 is coupled to the display unit 1030.

[0142] In addition, it should be noted that in the specific implementation of this application, object data related to component layout methods, etc. is involved. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0143] In some possible implementations, various aspects of the method for identifying the layout of page components provided by the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on a computer device, the computer program is used to enable the computer device to execute the steps of the method for identifying the layout of page components according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 3 Follow the steps shown in .

[0144] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0145] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.

[0146] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0147] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0148] The computer program for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer program may be executed entirely on the user's computer device, partially on the user's computer device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on the remote computer device. In the case of a remote computer device, the remote computer device may be connected to the user's computer device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer device (e.g., via the Internet using an Internet service provider).

[0149] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0150] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0151] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt 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.) that contain a computer-usable computer program.

[0152] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands 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 generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands 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.

[0153] These computer program commands 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 commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the 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.

[0155] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional 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 falling within the scope of the present application.

[0156] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for identifying a layout mode of a page component, characterized in that: include: Based on the page configuration information of the page to be identified, respectively determine the location information of each component in the page to be identified; The page to be identified includes at least one component, and the position information of each component includes: row positioning information and column positioning information of the corresponding component in the page to be identified; For the at least one component, the following operations are respectively performed: determining a first projection interval of the component on a first plane according to row positioning information of the component, and determining a second projection interval of the component on a second plane according to column positioning information of the component; the first plane is perpendicular to the second plane; According to the first projection interval and the second projection interval of each of the at least one component, a component layout mode of the at least one component included in the to-be-identified page is obtained.

2. The method according to claim 1, characterized in that The obtaining, according to the first projection interval and the second projection interval of each of the at least one component, a component layout mode of the at least one component included in the to-be-identified page comprises: Determining, according to the respective first projection intervals of the at least one component, a row layout mode of the at least one component included in the to-be-identified page; Determining, according to the respective second projection intervals of the at least one component, a column layout mode of the at least one component included in the to-be-identified page; The component layout mode is obtained according to the row layout mode and the column layout mode.

3. The method according to claim 2, characterized in that The row positioning information of each component includes the page second direction coordinates of each component and the height of each component, wherein the second direction is perpendicular to the first plane; Then, determining a first projection interval of a component on a first plane according to row positioning information of the component includes: Determine a starting position of a first projection interval corresponding to the component according to the second direction coordinate of the component, and determine a length of the first projection interval corresponding to the component according to the height of the component; An end position of the first projection interval is determined according to the start position and the length.

4. The method according to claim 3, characterized in that: The determining, according to the first projection interval of each of the at least one component, a row layout mode of the at least one component included in the to-be-identified page includes: According to the starting position and the ending position of the first projection interval of each of the at least one component, the obtained at least one first projection interval is divided into N first groups, where N is a positive integer; wherein if a first group includes at least two first projection intervals, there is an inclusion relationship or an intersection relationship between the at least two first projection intervals; Based on the value of N, a row layout of the at least one component included in the page to be identified is determined.

5. The method according to claim 4, characterized in that Before dividing the obtained at least one first projection interval into N first groups, the method further includes: Based on the start position and the end position of the first projection interval of each of the at least one component, when there is an overlapped interval between two first projection intervals, it is determined that there is an inclusion relationship or an intersection relationship between the two first projection intervals.

6. The method according to claim 2, characterized in that The column positioning information of each component includes a first direction coordinate of each component and a width of each component, wherein the first direction is perpendicular to the second plane; Then, determining a second projection interval of the component on the second plane according to the column positioning information of the component includes: Determine a starting position of a second projection interval corresponding to the component according to the first direction coordinate of the component, and determine a length of the second projection interval corresponding to the component according to the width of the component; An end position of the second projection interval is determined according to the start position and the length.

7. The method according to claim 6, characterized in that The determining, according to the respective second projection intervals of the at least one component, a column layout of the at least one component included in the to-be-identified page comprises: According to the starting position and the ending position of the second projection interval of each of the at least one component, the obtained at least one second projection interval is divided into M second groups, where M is a positive integer; wherein if a second group includes at least two second projection intervals, there is an inclusion relationship or an intersection relationship between the at least two second projection intervals; Based on the value of M, a column layout of the at least one component included in the page to be identified is determined.

8. The method according to claim 7, characterized in that Before dividing the obtained at least one second projection interval into M second groups, the method further includes: Based on the start position and the end position of the second projection interval of each of the at least one component, when there is an overlapped interval between the two second projection intervals, it is determined that there is an inclusion relationship or an intersection relationship between the two second projection intervals.

9. The method according to any one of claims 1 to 8, characterized in that: The determining, based on the page configuration information of the page to be identified, the location information of each component in the page to be identified includes: For the at least one component, perform the following operations respectively: Determine, according to an occupied area of ​​a component on the to-be-identified page in the page configuration information, a longest distance occupied by the component in a first direction and a second direction respectively; Determine a bounding rectangle of the component according to the longest distances occupied by the component in the first direction and the second direction respectively, and use the position information of the bounding rectangle as the position information of the component; two adjacent sides of the bounding rectangle are parallel to the first direction and the second direction respectively.

10. A device for identifying a layout of page components, characterized in that: include: A first processing unit, configured to determine the position information of each component in the page to be identified based on the page configuration information of the page to be identified; The page to be identified includes at least one component, and the position information of each component includes: row positioning information and column positioning information of the corresponding component in the page to be identified; a second processing unit, configured to respectively perform the following operations for the at least one component: determining a first projection interval of the component on a first plane according to row positioning information of the component, and determining a second projection interval of the component on a second plane according to column positioning information of the component; the first plane is a plane perpendicular to a first direction, the second plane is a plane perpendicular to a second direction, and the first direction is perpendicular to the second direction; The third processing unit is used to obtain a component layout mode of the at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of each of the at least one component.

11. The device according to claim 10, characterized in that When the third processing unit obtains the component layout mode of the at least one component included in the to-be-identified page according to the first projection interval and the second projection interval of each of the at least one component, it is used to: Determining, according to the respective first projection intervals of the at least one component, a row layout mode of the at least one component included in the to-be-identified page; Determining, according to the respective second projection intervals of the at least one component, a column layout mode of the at least one component included in the to-be-identified page; The component layout mode is obtained according to the row layout mode and the column layout mode.

12. The device according to claim 11, characterized in that The row positioning information of each component includes the second direction coordinate of each component and the height of each component; Then, when the second processing unit determines the first projection interval of a component on the first plane of the page according to the row positioning information of the component, it is used to: Determine a starting position of a first projection interval corresponding to the component according to the second direction coordinate of the component, and determine a length of the first projection interval corresponding to the component according to the height of the component; An end position of the first projection interval is determined according to the start position and the length.

13. A computer device, characterized in that: It comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 9.

14. A computer-readable storage medium, characterized in that: It includes program codes. When the program codes are run on a computer device, the program codes are used to make the computer device execute the steps of the method according to any one of claims 1 to 9.

15. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.