Page positioning method and device, equipment, storage medium and product

By comparing the control attributes in the mobile application page and positioning the page where the page to be located, the problem of not being able to achieve automated testing in mobile application testing is solved, and the testing efficiency and automation level are improved.

CN119759751AActive Publication Date: 2025-04-04BEIJING CO WHEELS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411147480.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-04-04
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

During the testing of mobile applications, it is impossible to actively implement page positioning, resulting in the inability to achieve complete automated testing.

Method used

By obtaining the control attribute collection in the page to be located, and comparing it with the attribute collection of each page control attribute in the page control map, positioning the page where the page to be located is based on the comparison result.

Benefits of technology

It realizes automatic positioning of pages to be positioned, solves the problem that the pages in mobile application testing cannot be positioned, and improves the degree of automation and testing efficiency of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759751A_ABST
    Figure CN119759751A_ABST
Patent Text Reader

Abstract

The invention discloses a page positioning method and device, equipment, a storage medium and a product, and relates to the field of page recognition. The page positioning method comprises the steps of obtaining a first control attribute set corresponding to a first control set in a to-be-positioned page; performing attribute comparison on the first control attribute set and a second control attribute set of a second control set of each page in the page control atlas to obtain an attribute comparison result; and the page where the to-be-positioned page is located is positioned according to the attribute comparison result, an important basis is provided for automatic testing of applications in the operating system, and the automation degree and the testing efficiency of the operating system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of page recognition, and in particular to a page positioning method, device, equipment, storage medium and product. Background Art

[0002] With the vigorous development of mobile Internet technology, the scale of mobile applications (Android / IOS applications) is getting larger and larger. How to ensure the quality of mobile applications through effective testing has become a difficult problem facing all mobile application development teams. Faced with frequent version releases and numerous device types, pure manual testing is gradually unable to cope with it, and the demand for automated testing is increasing. Automated testing simulates every step of the user's operation in an automatic way. Each step consists of "object positioning" and "object operation", among which the primary task is "object positioning". In the scenario of automated testing of mobile applications, the positioning of the page becomes an important foundation.

[0003] There are two main methods for identifying the page in traditional automated testing: the first is manual intervention and then automated testing. The second is to actively enter the page where the test point is located through an automated script. However, neither of these two methods can actively locate the page, and thus cannot achieve complete automated testing. Summary of the invention

[0004] The present invention provides a page positioning method, device, equipment, storage medium and product to solve the problem of being unable to locate the page during the testing process of mobile applications, and provides an important basis for the automated testing of mobile applications.

[0005] In a first aspect, an embodiment of the present invention provides a page positioning method, comprising:

[0006] Obtain a first control attribute set corresponding to a first control set in the page to be located;

[0007] Performing attribute comparison on the first control attribute set and the second control attribute set of the second control set of each page in the page control map to obtain an attribute comparison result;

[0008] The page where the page to be located is located is located according to the attribute comparison results.

[0009] In a second aspect, an embodiment of the present invention provides a page positioning device, including:

[0010] A first attribute acquisition module, used to acquire a first control attribute set corresponding to a first control set in a page to be located;

[0011] An attribute comparison module, used for comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map, to obtain an attribute comparison result;

[0012] The first page locating module is used to locate the page where the page to be located is located according to the attribute comparison results.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the page positioning method described in any embodiment of the present invention.

[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the page positioning method described in any embodiment of the present invention when executed.

[0018] In a fifth aspect, an embodiment of the present invention provides a computer program product including a computer program, and when the computer program is executed by a processor, the page positioning method described in any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention is to obtain a first control attribute set corresponding to a first control set in a page to be located; compare the first control attribute set with a second control attribute set of a second control set of each page in a page control map to obtain an attribute comparison result; and locate the page where the page to be located is located according to the attribute comparison result. The page to be located is located based on the matching degree of the control attributes in the page, and the page to be located is automatically located, which solves the problem of being unable to locate the page during the testing process of the mobile application, provides an important basis for the automated testing of applications in the operating system, and is conducive to improving the automation level and testing efficiency of the operating system.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A flow chart of a page positioning method provided in Embodiment 1 of the present invention;

[0023] Figure 2 A flow chart of a page positioning method provided in Embodiment 2 of the present invention;

[0024] Figure 3 A flowchart of a page positioning method provided in Embodiment 3 of the present invention;

[0025] Figure 4 A schematic diagram of the structure of a page positioning device provided in Embodiment 4 of the present invention;

[0026] Figure 5 It is a structural schematic diagram of an electronic device for implementing the page positioning method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment 1

[0030] Figure 1This is a flow chart of a page positioning method provided in the first embodiment of the present invention. This embodiment is applicable to the situation where the page where the application is located in the operating system is located. The method can be executed by a page positioning device, which can be implemented in the form of hardware and / or software, and the page positioning device can be configured in an electronic device. The page positioning provided by the embodiment of the present invention can be applicable to the situation where the operating system needs to position the page, and is particularly applicable to the automated testing scenario of the application in the Android or iOS operating system.

[0031] like Figure 1 As shown, the method includes:

[0032] S110: Obtain a first control attribute set corresponding to a first control set in the page to be located.

[0033] The page to be located can be understood as a page waiting to be located in an application of the operating system, such as a page currently being accessed. The first control set can be understood as a set consisting of first controls in the page to be located, where a control refers to a visual graphic "component" that can be placed on a form, such as a button, a file edit box, etc.; the first control attribute set can be understood as a set consisting of attributes contained in each first control in the page to be located.

[0034] Specifically, a data crawling tool or a data crawling algorithm is used to crawl each first control contained in the page to be located to form a first control set, and control properties of each first control in the first control set are obtained to form a first control property set.

[0035] S120: Perform attribute comparison between the first control attribute set and the second control attribute set of the second control set of each page in the page control map to obtain an attribute comparison result.

[0036] Among them, the page control map can be understood as a map drawn by the pages in the operating system, the controls contained in the pages, and the control attributes. The function of the page control map is to reflect the jump relationship between pages, the inclusion relationship between pages and controls, and the attribute information of controls. The attribute comparison result is the comparison result between the attributes of the first control in the page to be located and the attributes of the controls in each page in the page control map. The attribute comparison result is intended to indicate the degree of match between the page to be located and each page in the page control map. The attribute comparison result may include: whether the second control attribute set contains the first control attribute set, or the number of first control attribute sets contained in the second control attribute set.

[0037] Specifically, the first control attribute set corresponding to the first control set in the page to be located is compared with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result between the page to be located and each control in each page in the page control map.

[0038] It is understandable that before locating the page to be located, it is necessary to crawl the pages of various applications in the operating system, the controls in the pages and the control attribute information, draw a page control map, and store it in the computer device for use.

[0039] In an optional embodiment, before the step of obtaining a first control attribute set corresponding to a first control set in a page to be located, the step also includes: drawing a page map of each application in the operating system, wherein the page map includes pages in the application and jump relationships between pages; obtaining a second control set in each page under the page map, and obtaining a second control attribute set of the second control set; and constructing a page control map according to the page map of the operating system, the second control set and the corresponding second control attribute set.

[0040] Specifically, a data crawling tool or a data crawling algorithm is used to crawl a second control set and a second control attribute set corresponding to the second control set from the pages of each application in the operating system. A page map is drawn according to the jump relationship between pages, and each node in the page map represents a page. On the basis of the page map, the second controls contained in each page and the second control attributes corresponding to each second control are drawn under each page, thereby forming a page control map. The second control attributes may include: common attributes of the second control, and may also include aggregated attributes of multiple common attributes.

[0041] Optionally, the common properties of the control include at least one of the following: control identifier, control class name, control display text, control description, whether the control is selected, whether the control is clickable, whether the control is enabled, whether the control can be selected, and whether the control has focus.

[0042] Specifically, the control identifier ID has the function of uniquely identifying the control. The control class name class is used to indicate the control type and can be defined by the developer. There may be multiple controls with the same control class name, and uniqueness cannot be guaranteed. The control display text text indicates the text content displayed on the control. The control description description / content-desc is used to describe the function of the control. Some controls may lack this attribute. Whether the control is checked is usually used for controls such as checkboxes, radio buttons, switches, etc. Whether the control is clickable is clickable. If clickable returns false, it means that the control is currently not clickable. Whether the control is enabled is enabled. If not, it means that the control cannot be operated. Whether the control is selectable is checkable. Returning false indicates an unselectable state, which means that the button will be automatically released after clicking. Whether the control has focus is focused, which is used to indicate whether the control has input focus.

[0043] S130: Locate the page where the page to be located is located according to the attribute comparison result.

[0044] In addition to locating the page where the page to be located is located as one of the positioning results, the name or identification number of the page can also be obtained as the positioning result.

[0045] Specifically, the basic principle of locating the page where the page to be located is located according to the attribute comparison result is to determine the page that best matches the page to be located as the page where the page to be located is located according to the attribute comparison result of each page. The specific expression form of the matching degree can be a matching probability or a matching weight, etc., which is not limited in this embodiment.

[0046] In this embodiment, by comparing the control attributes contained in the page to be located with the control attributes in each page of the application, the page to be located is located based on the matching degree of the control attributes in the page, thereby achieving the location of the page to be located, providing an important basis for the automated testing of applications in the operating system.

[0047] The technical solution of the embodiment of the present invention is to obtain a first control attribute set corresponding to a first control set in a page to be located; compare the attributes of the first control attribute set with a second control attribute set of a second control set of each page in a page control map to obtain an attribute comparison result; and locate the page where the page to be located is located according to the attribute comparison result, which provides an important basis for automated testing of applications in an operating system and is conducive to improving the degree of automation and testing efficiency of the operating system.

[0048] Embodiment 2

[0049] Figure 2This is a flow chart of a page positioning method provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment further refines the process of generating attribute comparison results and the process of performing page positioning based on the attribute comparison results, specifically:

[0050] The step of performing attribute comparison between the first control attribute set and the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result includes: respectively obtaining the core attributes corresponding to each first control of the first control set in the first control attribute set; for each first control, performing attribute comparison between the core attributes and the second control attribute set of the second control set of each page in the page control map to obtain the number of core attributes corresponding to each of the first controls contained in the second control attribute set, and taking the number of core attributes corresponding to each of the first controls contained in the second control attribute set as the attribute comparison result.

[0051] And the step of locating the page where the page to be located is located according to the result of comparing each of the attributes includes: determining the number of core attributes corresponding to the first control included in the second control attribute set as the weight of the page where the corresponding second control set is located; and determining the page with the largest weight as the page where the page to be located is located.

[0052] like Figure 2 As shown, the method includes:

[0053] S210: Obtain a first control attribute set corresponding to a first control set in the page to be located.

[0054] S220: Obtain the core attributes corresponding to each first control in the first control attribute set respectively.

[0055] The core attributes of the first control are the attributes of related controls with the first control as the core. Optionally, the core attributes include: the common attributes of the first control; or the aggregated attributes of the key attributes of the first control and the key attributes of the parent control of the first control; wherein the key attributes are selected from the common attributes.

[0056] It should be noted that the upper level control includes: the upper level control (i.e., the parent control), the upper two level control (i.e., the parent control of the parent control), and a higher level control. For example, the first control is a volume adjustment control, the upper level control is a music playback control, and the key attribute text of the volume adjustment control and the key attribute text of the music playback control are aggregated as the core attribute of the volume adjustment control.

[0057] In the process of page positioning based on the comparison of control properties between pages, there may be some special cases. For example, the common properties of multiple different controls on the same page are the same. At this time, it is not accurate enough to position the page only through the common properties of the first control. Therefore, this embodiment uses the nested relationship of controls within the page to aggregate the key properties of the first control with the key properties of the parent control of the first control to obtain aggregated properties, which greatly improves the recognition of control properties, thereby improving the accuracy of the results of page positioning based on property comparison.

[0058] S230. For each first control, the core attributes are compared with the second control attribute set of the second control set of each page in the page control map, the number of core attributes corresponding to each first control included in the second control attribute set is obtained, and the number of core attributes corresponding to each first control included in the second control attribute set is used as the attribute comparison result.

[0059] Specifically, for each first control, the core attributes of the first control are compared one by one with the second control attributes contained in the second control attribute set of the second control set of each page in the page control map; if the second control attribute is the same as the core attribute of the first control, the statistical value is increased by one, so as to count the number of core attributes corresponding to each first control contained in the second control attribute set, and the number of core attributes corresponding to each first control contained in the second control attribute set is used as the attribute comparison result between the first control attribute set and the second control attribute set.

[0060] S240: Determine the number of core attributes corresponding to the first control in the second control attribute set as the weight of the page where the second control set is located.

[0061] The weight of the page is used to indicate the degree of matching between the page and the control attributes of the page to be located.

[0062] Specifically, for each first control in the first control set, the core attributes of the first control are compared with the second control attribute set of the second control set of each page in the page control map. If it is found that the second control attribute set contains the core attributes corresponding to the first control, for example, there is the same XML Path Language (Xpath) value, then the weight of the page where the second control set is located is added by 1, so as to obtain the weight of each page in the page control map.

[0063] S250: Determine the page with the largest weight as the page where the page to be located is located.

[0064] Specifically, the page with the largest weight is determined as the page where the page to be located is located, that is, the page where the page to be located is located. Further, the page name of the page to be located is obtained as the location result of the page to be located, which is convenient for using the page to be located during the application test process.

[0065] The technical solution of the embodiment of the present invention is to obtain the first control attribute set corresponding to the first control set in the page to be located; respectively obtain the core attribute corresponding to each first control of the first control set in the first control attribute set; for each first control, respectively compare the core attribute with the second control attribute set of the second control set of each page in the page control map, obtain the number of core attributes corresponding to each first control contained in the second control attribute set, and use the number of core attributes corresponding to each first control contained in the second control attribute set as the result of attribute comparison; for the second control attribute set of the second control set of each page in the page control map, determine the number of core attributes corresponding to the first control contained in the second control attribute set as the weight of the page corresponding to the second control set; determine the page with the largest weight as the page where the page to be located is located. Use the aggregated attributes of the first control and its parent control to compare attributes to achieve page location, while providing an important basis for the automated testing of applications in the operating system, improve the accuracy of page location, and help improve the automation level and testing efficiency of the operating system.

[0066] Embodiment 3

[0067] Figure 3 A flow chart of a page positioning method provided in Embodiment 3 of the present invention. Based on the above embodiments, this embodiment further refines the steps of comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result, including: obtaining a unique control attribute set of a unique control set; the unique control set includes: a single unique control or a combined unique control of each page in the page control map; comparing the unique control attribute set with the first control attribute set to determine whether the page to be located contains a unique control; if the page to be located does not contain a unique control, comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result.

[0068] like Figure 3 As shown, the method includes:

[0069] S310: Obtain a first control attribute set corresponding to a first control set in the page to be located.

[0070] S320, obtaining a unique control attribute set of a unique control set. The unique control set includes: a unique control of each page in the page control map, wherein the unique control includes a single unique control or a combination of unique controls.

[0071] Among them, the unique control set is a set consisting of unique controls on each page in the page control map. A unique control can be understood as a control with unique properties in the page of each application. The unique control attribute set is a set consisting of the control attributes of each unique control in the unique control set. In this embodiment, the unique control can be a single unique control or a combined unique control. A single unique control refers to a single control with uniqueness; a combined unique control refers to a control with uniqueness in combination of at least two controls, and each control alone may not be unique.

[0072] Specifically, the unique control can be configured and optimized by the developer, and can also be adjusted and maintained according to changes in pages and controls of different applications.

[0073] S330: perform attribute comparison between the unique control attribute set and the first control attribute set to determine whether the page to be located contains the unique control.

[0074] Specifically, for the unique control attributes corresponding to each unique control in the unique control attribute set, attributes are compared with the first control attribute set corresponding to the first control set in the page to be located, to determine whether there is any unique control attribute in the first control attribute set; if so, it is determined that the page to be located contains a unique control; if not, it is determined that the page to be located does not contain a unique control.

[0075] S340: If it is determined that the page to be located contains a unique control, the page where the unique control is located is determined as the page where the page to be located is located.

[0076] Specifically, if it is determined that the page to be located contains a unique control, the page containing the unique control is determined as the page where the page to be located is located, that is, the page to be located is the page containing the unique control. Further, the page name of the page to be located is obtained as the location result of the page to be located, which is convenient for using the page to be located during the application testing process.

[0077] For example, the control that generally exists in the page to be located [Music Player - I Like Page] is xpath=" / / android.widget.TextView[@text="I like it"]".

[0078] However, this control may appear on other pages in the same application, which may result in recognition errors if only this control is used to locate the page. Therefore, in addition to this control, a related control must be associated, such as the back button: / / android.widget.ImageButton[@description='Back'].

[0079] In this way, the combination of these two controls constitutes a combined unique control, and the only page where this combined unique control appears is [Music Player - My Favorite Page]. In this way, the page to be located can be quickly located as [Music Player - My Favorite Page].

[0080] In this embodiment, the uniqueness of the control attribute of the unique control is used to design a fallback logic, and a first control attribute set corresponding to the first control set in the page to be located is preferentially compared with the attributes. If the page to be located contains a unique control, the page to be located can be quickly located without performing a subsequent attribute comparison process with the second control attribute set of the second control set of each page in the page control map. In addition, the number of unique controls in each page is limited, the amount of data is small, and the fallback logic is simple, thus reducing the resource consumption of page location and improving the efficiency of page location.

[0081] S350: If the page to be located does not contain a unique control, obtain the core attribute corresponding to each first control in the first control set in the first control attribute set.

[0082] Specifically, if the page to be located does not contain a unique control, it means that the page to be located does not have a unique control or the current fallback logic does not contain the unique control attribute of the page to be located, and the page to be located cannot be quickly located based on the unique control attribute. In this case, S360 to S380 need to be executed to locate the page to be located. S360 to S380 refer to S220 to S250 of the above embodiment, and this embodiment will not be repeated.

[0083] S360. For each first control, the core attributes are compared with the second control attribute set of the second control set of each page in the page control map, and the number of core attributes corresponding to each first control included in the second control attribute set is obtained, and the number of core attributes corresponding to each first control included in the second control attribute set is used as the attribute comparison result.

[0084] In an optional embodiment, after comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result, it also includes: if the attribute comparison results corresponding to at least two pages contained in the page control map are the same, then the unique control attributes of the unique controls in each page with the same attribute comparison results are added to the unique control attribute set.

[0085] Specifically, if the page control map contains at least two pages with the same attribute comparison results, it is not possible to directly determine which page the page to be located belongs to, which is undesirable in the automated testing process. In the previous fallback logic, the page in this situation cannot be directly located, indicating that the configuration of the fallback logic needs to be optimized.

[0086] In this embodiment, by obtaining the unique control attributes of the unique control in each page with the same attribute comparison result, and adding the unique control attributes of the unique control to the unique control attribute set, the unique control attribute set in the fallback logic can be maintained and optimized, and the fallback logic can be used to reduce the occurrence of situations where it is impossible to directly determine which page the page to be located belongs to due to the same attribute comparison results corresponding to at least two pages, which is beneficial to improving the degree of automation of application testing.

[0087] S370: Determine the number of core attributes corresponding to the first control in the second control attribute set as the weight of the page where the second control set is located.

[0088] S380: Determine the page with the largest weight as the page where the page to be located is located.

[0089] The technical solution of the embodiment of the present invention is as follows: by obtaining a first control attribute set corresponding to a first control set in a page to be located; obtaining a unique control attribute set of a unique control set, the unique control set including: a unique control of each page in a page control map, the unique control including a single unique control or a combination of unique controls; comparing the unique control attribute set with the first control attribute set to determine whether the page to be located contains a unique control; if it is determined that the page to be located contains a unique control, the page where the unique control is located is determined as the page where the page to be located is located; if the page to be located does not contain a unique control, the first control attribute set is compared with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result; and locating the page where the page to be located is located according to the attribute comparison results. The page to be located is located by using the bottom-up logic based on the unique control attribute to preferentially locate the page to be located, and if it cannot be located, the second control attribute set of the second control set of each page in the page control map is compared with the second control attribute set of the second control set of each page in the page control map to determine the location of the page to be located; while providing an important basis for the automated testing of applications in the operating system, the resource consumption of page location is reduced, the efficiency of page location is improved, and it is beneficial to improve the automation degree and testing efficiency of the operating system.

[0090] Embodiment 4

[0091] Figure 4 This is a schematic diagram of the structure of a page positioning device provided by Embodiment 4 of the present invention. Figure 4 As shown, the device includes: a first attribute acquisition module 410, an attribute comparison module 420 and a first page positioning module 430; wherein,

[0092] The first attribute acquisition module 410 is used to acquire a first control attribute set corresponding to a first control set in the page to be located;

[0093] The property comparison module 420 is used to compare the first control property set with the second control property set of the second control set of each page in the page control map to obtain a property comparison result; the page control map is a map drawn by the pages in the operating system, the controls contained in the pages, and the control properties;

[0094] The first page locating module 430 is used to locate the page where the page to be located is located according to the attribute comparison results.

[0095] The technical solution of the embodiment of the present invention is to obtain a first control attribute set corresponding to a first control set in a page to be located; compare the attributes of the first control attribute set with a second control attribute set of a second control set of each page in a page control map to obtain an attribute comparison result; and locate the page where the page to be located is located according to the attribute comparison result, which provides an important basis for automated testing of applications in an operating system and is conducive to improving the degree of automation and testing efficiency of the operating system.

[0096] Optionally, the attribute comparison module 420 includes:

[0097] A unique attribute acquisition unit, used to acquire a unique control attribute set of a unique control set; the unique control set includes a unique control of each page in the page control map, and the unique control includes a single unique control or a combination of unique controls;

[0098] A first attribute comparison unit, configured to compare the attribute set of the unique control with the first attribute set of the first control to determine whether the page to be located contains a unique control;

[0099] The second attribute comparison unit is used to compare the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain an attribute comparison result if the page to be located does not contain a unique control.

[0100] Optionally, also include:

[0101] The second page positioning module is used to compare the attribute information of the unique control with the first control attribute set of the first control set to determine whether the page to be positioned contains the unique control. If it is determined that the page to be positioned contains the unique control, the page where the unique control is located is determined as the page where the page to be positioned is located.

[0102] Optionally, also include:

[0103] The attribute adding module is used for comparing the attributes of the first control attribute set with the second control attribute set of the second control set of each page in the page control map respectively, and after obtaining the attribute comparison result, if the attribute comparison results corresponding to at least two pages contained in the page control map are the same, then the unique control attributes of the unique controls in each page with the same attribute comparison result are added to the unique control attribute set.

[0104] Optionally, the attribute comparison module 420 includes:

[0105] A core attribute acquisition unit, used to respectively acquire the core attribute corresponding to each first control of the first control set in the first control attribute set;

[0106] The third attribute comparison unit is used to compare the core attributes with the second control attribute set of the second control set of each page in the page control map for each first control, obtain the number of core attributes corresponding to each of the first controls contained in the second control attribute set, and take the number of core attributes corresponding to each of the first controls contained in the second control attribute set as the attribute comparison result.

[0107] Optionally, the first page positioning module 430 is specifically configured to:

[0108] Determine the number of core attributes corresponding to the first control included in the second control attribute set as the weight of the page where the second control set is located;

[0109] The page with the largest weight is determined as the page where the page to be located is located.

[0110] Optionally, the core attributes include: common attributes of the first control;

[0111] Alternatively, the key attribute of the first control and the aggregate attribute of the key attribute of the parent control of the first control; wherein the key attribute is selected from the common attributes.

[0112] Optionally, the general attribute includes at least one of the following:

[0113] Control identifier, control class name, control display text, control description, whether the control is selected, whether the control can be clicked, whether the control is enabled, whether the control can be selected, and whether the control has focus.

[0114] Optionally, also include:

[0115] A page map drawing module, used for drawing a page map of each application in the operating system before the step of obtaining a first control attribute set corresponding to a first control set in the page to be located, wherein the page map includes pages in the application and jump relationships between the pages;

[0116] A second attribute acquisition module, used to acquire a second control set in each page of the page map, and acquire a second control attribute set of the second control set;

[0117] The page control graph construction module is used to construct a page control graph according to the page graph of the operating system, the second control set and the corresponding second control attribute set.

[0118] The page positioning device provided in the embodiment of the present invention can execute the page positioning method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0119] Embodiment 5

[0120] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0121] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0122] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0123] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a page positioning method.

[0124] In some embodiments, the page positioning method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the page positioning method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the page positioning method in any other appropriate manner (e.g., by means of firmware).

[0125] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0126] In some embodiments, the page positioning method can be implemented as a computer program, which is invisibly included in a computer program product, and the computer program implements the page positioning method of the present invention when executed by a processor. The computer program product can be understood as a software product that mainly implements its solution through a computer program. The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the computer program, when executed by the processor, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or entirely on a remote machine or server.

[0127] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0128] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0129] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0130] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0131] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0132] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A page positioning method, characterized in that: include: Obtain a first control attribute set corresponding to a first control set in the page to be located; Compare the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain an attribute comparison result; the page control map is a map drawn by pages in the operating system, controls contained in the pages, and control attributes; The page where the page to be located is located is located according to the attribute comparison results.

2. The page positioning method according to claim 1, characterized in that: The step of performing attribute comparison on the first control attribute set and the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result includes: Acquire a unique control attribute set of a unique control set; the unique control set includes unique controls of each page in the page control map, and the unique controls include a single unique control or a combination of unique controls; Comparing the unique control attribute set with the first control attribute set to determine whether the page to be located contains a unique control; If the page to be located does not include a unique control, the first control attribute set is compared with the second control attribute set of the second control set of each page in the page control map to obtain an attribute comparison result.

3. The page positioning method according to claim 2, characterized in that: After comparing the unique control attribute information with the first control attribute set of the first control set to determine whether the page to be located includes a unique control, the method further includes: If it is determined that the page to be located contains a unique control, the page where the unique control is located is determined as the page where the page to be located is located.

4. The page positioning method according to any one of claims 2-3, characterized in that: After the step of comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result, the method further includes: If the attribute comparison results corresponding to at least two pages in the page control map are the same, the unique control attributes of the unique controls in each page with the same attribute comparison results are added to the unique control attribute set.

5. The page positioning method according to any one of claims 1 to 3, characterized in that: The step of performing attribute comparison between the first control attribute set and the second control attribute set of the second control set of each page in the page control map to obtain the attribute comparison result comprises: Respectively obtain the core attributes corresponding to each first control in the first control attribute set of the first control set; For each first control, the core attributes are compared with the second control attribute set of the second control set of each page in the page control map, the number of core attributes corresponding to each of the first controls contained in the second control attribute set is obtained, and the number of core attributes corresponding to each of the first controls contained in the second control attribute set is used as the attribute comparison result.

6. The page positioning method according to claim 5, characterized in that: The step of locating the page where the page to be located is located according to the attribute comparison results comprises: Determine the number of core attributes corresponding to the first control included in the second control attribute set as the weight of the page where the second control set is located; The page with the largest weight is determined as the page where the page to be located is located.

7. The page positioning method according to claim 5, characterized in that: The core attributes include: common attributes of the first control; Alternatively, the key attribute of the first control and the aggregate attribute of the key attribute of the parent control of the first control; wherein the key attribute is selected from the common attributes.

8. The page positioning method according to claim 7, characterized in that: The common attributes include at least one of the following: Control identifier, control class name, control display text, control description, whether the control is selected, whether the control can be clicked, whether the control is enabled, whether the control can be selected, and whether the control has focus.

9. The page positioning method according to any one of claims 1 to 3, characterized in that: Before the step of obtaining the first control attribute set corresponding to the first control set in the page to be located, the method further includes: Draw a page map of each application in the operating system, wherein the page map includes pages within the application and jump relationships between pages; Acquire a second control set in each page of the page map, and acquire a second control attribute set of the second control set; A page control map is constructed according to the page map of the operating system, the second control set and the corresponding second control attribute set.

10. A page positioning device, characterized in that: include: A first attribute acquisition module, used to acquire a first control attribute set corresponding to a first control set in a page to be located; An attribute comparison module, used for comparing the first control attribute set with the second control attribute set of the second control set of each page in the page control map, to obtain an attribute comparison result; The first page locating module is used to locate the page where the page to be located is located according to the attribute comparison results.

11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the page positioning method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the page positioning method according to any one of claims 1 to 9 when executed.

13. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the page positioning method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for recognizing similar webpages

    CN103049562A

  • Page identification method and terminal equipment

    CN114463730A

  • Page test method and device, electronic equipment and storage medium

    CN115098362A