Page compatibility testing method, device, equipment, and storage medium

By dividing and similarity calculation of the test pages, the problems of high cost, low efficiency and low accuracy of compatibility testing in the prior art are solved, and efficient and accurate compatibility testing is achieved.

CN114896157BActive Publication Date: 2025-09-05SHENZHEN FUTU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210546281.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-18
Publication Date
2025-09-05
Estimated Expiration
2042-05-18

AI Technical Summary

Technical Problem

In the prior art, when performing compatibility testing on pages to be tested at different resolutions through manual testing, the cost is high, the efficiency is low and the accuracy is low, and the location of the specific compatibility problem cannot be determined.

Method used

By dividing the pages to be tested, multiple sub-pages to be tested are obtained, and each sub-page is assigned an identification number, traversed each page for similarity calculation, and the compatibility calculation results are determined, including technical means such as size adjustment, grayscale processing, pixel value comparison and image histogram analysis.

Benefits of technology

Improves the accuracy and efficiency of compatibility testing, reduces testing costs, and can quickly locate the specific location of compatibility issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896157B_ABST
    Figure CN114896157B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method and apparatus, device, and storage medium for compatibility testing of a page. The present application divides and sorts at least two pages to be tested to obtain each page to be tested that contains multiple sub-pages to be tested, and each sub-page to be tested has an identification number, and then traverses each page to be tested, thereby ensuring that the same page to be tested at different resolutions can be traversed, and the traversed page to be tested is used as the target test page, and the sub-page to be tested with the specified identification number in the target test page is similarly calculated with the sub-page to be tested with the specified identification number in other pages to be tested, and the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page is obtained, so that the compatibility calculation result is more accurate. In addition, the testing cost is low during the entire test process, which reduces the testing cost while improving the test accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method and apparatus, device, and storage medium for testing the compatibility of a page. Background Art

[0002] During software testing, we often encounter the need to verify the compatibility of the tested page on different devices. Different devices have different compatible page resolutions. Currently, manual testing of the compatibility of the tested page at different resolutions is costly and inefficient. Furthermore, the test only calculates the compatibility of the entire tested page, resulting in low accuracy. Summary of the Invention

[0003] To solve the above technical problems, the embodiments of the present application provide a page compatibility testing method and apparatus, device, and storage medium to improve test accuracy and test efficiency.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a page compatibility testing method is provided, comprising: obtaining association information of target objects contained in at least two pages to be tested; dividing each page to be tested based on the association information of the target objects contained in each page to be tested, to obtain each page to be tested containing multiple sub-pages to be tested; wherein each sub-page to be tested has an identification number; traversing each page to be tested, taking the traversed page to be tested as a target test page, and performing similarity calculation on the sub-page to be tested with a specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, to obtain a compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

[0006] According to one aspect of an embodiment of the present application, a page compatibility testing device is provided, comprising: an acquisition module configured to acquire association information of target objects contained in at least two pages to be tested; a division module configured to divide each page to be tested based on the association information of the target objects contained in each page to be tested, to obtain each page to be tested comprising multiple sub-pages to be tested; wherein each sub-page to be tested has an identification number; a calculation module configured to traverse each page to be tested, and use the traversed page to be tested as a target test page, perform similarity calculation on the sub-page to be tested with a specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, to obtain a compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

[0007] According to one aspect of an embodiment of the present application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, which, when executed by the controller, performs the above-mentioned page compatibility testing method.

[0008] According to one aspect of an embodiment of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned page compatibility testing method.

[0009] According to one aspect of an embodiment of the present application, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described page compatibility testing method.

[0010] In the technical solution provided in the embodiments of the present application, by dividing and sorting at least two pages to be tested, each page to be tested containing multiple sub-pages to be tested is obtained, and each sub-page to be tested has an identification number, and then each page to be tested is traversed, so as to ensure that the same page to be tested at different resolutions can be traversed, and the traversed page to be tested is used as the target test page, and the similarity calculation is performed between the sub-page to be tested with the specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, and the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page is obtained, so that the compatibility calculation result is more accurate and the efficiency of page testing is effectively improved.

[0011] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0013] Figure 1 This is a schematic diagram of the test page with the same content on three different models;

[0014] FIG2( a ) is a flow chart of a method for testing page compatibility according to an exemplary embodiment of the present application;

[0015] FIG2( b ) is a schematic diagram of a process of dividing sub-pages to be tested of different models, shown in an exemplary embodiment of the present application;

[0016] Figure 3 is a flow chart of another page compatibility testing method proposed based on the embodiment shown in FIG2( a );

[0017] Figure 4 is based on Figure 3 A flowchart of another page compatibility testing method proposed in the illustrated embodiment;

[0018] Figure 5 is a schematic diagram of a process of calculating similarity between a first pixel value and each second pixel value, shown in another exemplary embodiment of the present application;

[0019] Figure 6 is a schematic diagram of a process of similarity calculation for a first sub-page and a second sub-page, shown in another exemplary embodiment of the present application;

[0020] Figure 7 is based on Figure 3 A flowchart of another page compatibility testing method proposed in the illustrated embodiment;

[0021] Figure 8 is based on Figure 7 A flowchart of another page compatibility testing method proposed in the illustrated embodiment;

[0022] Figure 9 is a flowchart of another page compatibility testing method shown in another exemplary embodiment of the present application;

[0023] Figure 10 is a flowchart of another page compatibility testing method shown in another exemplary embodiment of the present application;

[0024] Figure 11 is based on Figure 10 A flowchart of another page compatibility testing method proposed in the illustrated embodiment;

[0025] Figure 12 1 is a schematic structural diagram of a page compatibility testing device according to an exemplary embodiment of the present application;

[0026] Figure 13 It is a schematic diagram of an implementation environment involved in this application;

[0027] Figure 14 is a schematic diagram of another implementation environment involved in this application;

[0028] Figure 15 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0029] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0031] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0032] In this application, "plurality" refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0033] During software testing, we often encounter the need to verify the compatibility of the tested page on different models. Different models are compatible with different page resolutions, such as Figure 1 As shown, Figure 1It is a schematic diagram of the test page with the same content on three different models. Among them, the resolution of each test page is different. At present, the entire test page is generally tested by manual testing to find compatibility problems. The test obtains the compatibility calculation result of the entire test page, and cannot determine the specific location of the compatibility problem in the test page, and the test accuracy is low. To this end, in the process of testing each test page with different resolutions, in order to determine whether the sub-page to be tested in the target test page has a compatibility problem, the present application provides a page compatibility testing method as shown in Figure 2 (a). Figure 2 (a) is a flow chart of a page compatibility testing method shown in an exemplary embodiment of the present application. Among them, the method includes at least S210 to S230, which are described in detail as follows:

[0034] S210: Obtaining association information of target objects contained in at least two pages to be tested.

[0035] In this embodiment, the page to be tested is a static page. The target object is an object present in the page to be tested, which can be an object with content or a node object of an object with content. The associated information is information contained in the target object, such as the row height and column width of the target object in the page to be tested, which can accurately represent information such as the position and size of the target object on the page.

[0036] For example, multiple pages to be tested are captured, and target objects contained in each page to be tested are identified, thereby obtaining associated information of each target object. For example, if a page to be tested at a certain resolution has four target objects, information such as row height and column width of each of the four target objects is obtained.

[0037] S220: Divide each page to be tested based on the associated information of the target object contained in each page to be tested, so as to obtain each page to be tested including a plurality of sub-pages to be tested; wherein each sub-page to be tested has an identification number.

[0038] According to the associated information of the target object, each page to be tested can be divided to obtain multiple sub-pages to be tested, and they are sorted and numbered so that each sub-page to be tested has a specific identification number. In addition, according to the associated information of the target object, the target object in each page to be tested can be intercepted and the page to be tested can be divided to obtain a plurality of sub-pages to be tested, wherein each sub-page to be tested contains a target object with a specific identification number. As shown in Figure 2(b), Figure 2(b) is a schematic diagram of the division process of sub-pages to be tested of different models shown in an exemplary embodiment of the present application, that is, a schematic diagram of the division process of sub-pages to be tested of pages to be tested with different resolutions. Wherein, Page represents each page to be tested, the resolution of the page to be tested of model 1 is the first resolution, the resolution of the page to be tested of model 2 is the second resolution, and the resolution of the page to be tested of model 3 is the third resolution, and the page to be tested of the resolution corresponding to each model is divided into div 1 to div n sub-pages to be tested.

[0039] S230: traverse each page to be tested, take the traversed page to be tested as the target test page, and calculate the similarity between the sub-page to be tested with the specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, to obtain the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

[0040] During the similarity calculation process, if there is at least one to-be-tested sub-page with a specified identification number in the other to-be-tested pages, and if there is no to-be-tested sub-page with the specified identification number in the other to-be-tested pages, the compatibility of the to-be-tested sub-page with the specified identification number is set to zero to indicate that the to-be-tested sub-page is only displayed in the to-be-tested page.

[0041] S230 is exemplified by selecting a page to be tested at a certain resolution as a target test page, and performing similarity calculation on a sub-page to be tested with a specified identification number in the page to be tested and the sub-page to be tested with a specified identification number in other pages to be tested. For example, a page to be tested at a resolution of 10x10 is selected as the target test page, and performing similarity calculation on the sub-page to be tested with an identification number of 2. First, it is necessary to obtain the sub-page to be tested with an identification number of 2 in the page to be tested at other resolutions, and then perform similarity calculation on the sub-page to be tested with an identification number of 2 in the target test page and the sub-page to be tested with an identification number of 2 in other pages to be tested, thereby obtaining the compatibility calculation result of the sub-page to be tested with an identification number of 2 in the target test page.

[0042] This embodiment divides and sorts at least two pages to be tested to obtain each page to be tested containing multiple sub-pages to be tested, and each sub-page to be tested has an identification number. Then, each page to be tested is traversed to ensure that the same page to be tested at different resolutions can be traversed, and the traversed page to be tested is used as the target test page. The sub-page to be tested with the specified identification number in the target test page is similarly calculated with the sub-page to be tested with the specified identification number in other pages to be tested, and the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page is obtained, making the compatibility calculation result more accurate. In addition, the testing cost is low during the entire testing process, which reduces the testing cost while improving the test accuracy.

[0043] In the existing page similarity calculation process, two pages are generally directly calculated, which will cause a large calculation error. Therefore, in another exemplary embodiment, the following is provided: Figure 3 The compatibility test method of the page shown, Figure 3 This is a flow chart of another page compatibility testing method proposed based on the embodiment shown in FIG2(a). The method further includes S310 to S330 in S230 shown in FIG2(a), which are described in detail below:

[0044] S310: The sub-page to be tested with the specified identification number in the target test page is used as the first sub-page, and the sub-page to be tested with the specified identification number in other pages to be tested is used as the second sub-page.

[0045] The first and second sub-pages are equivalent to a marked sub-page, which is not a fixed sub-page. The specific sub-page represented by the first sub-page varies depending on the identification number. In addition, in this embodiment, the second sub-page includes at least one sub-page to be tested with a specified identification number. The number of second sub-pages corresponds to the number of sub-pages to be tested with the specified identification number in the other pages to be tested.

[0046] S320: If it is detected that the size of the first subpage is different from the size of the second subpage, the sizes of the first subpage and the second subpage are adjusted to obtain the first subpage and the second subpage of the same size.

[0047] Exemplarily, the sizes of the first sub-page and the second sub-page are unified, for example, the sizes of the first sub-page and the second sub-page are both adjusted to 5×5 cm.

[0048] S330: Calculate similarity between the first sub-page and the second sub-page of the same size to obtain a compatibility calculation result of the first sub-page.

[0049] Calculating the similarity between the first and second subpages after unifying their sizes can, to a certain extent, reduce errors in the similarity calculation process. For example, before converting the corresponding subpages to DCT (Discrete Cosine Transform) values ​​for calculation and comparison, the page sizes need to be unified; otherwise, large errors will occur during the DCT value conversion process.

[0050] For example, a first subpage and a second subpage of the same size are subjected to a structural similarity calculation, and the two are converted into first and second DCT values, respectively, with only the low-frequency portion retained during the conversion process. The first and second DCT values ​​are then compared to obtain a degree of difference between the two, thereby obtaining a compatibility calculation result for the first subpage. For example, the absolute value of the difference between the first and second DCT values ​​is divided by the first DCT value to obtain a degree of difference between the first DCT value and the second DCT value, and this degree of difference is used as the compatibility calculation result for the first subpage.

[0051] In this embodiment, the sizes of the compared sub-pages are uniformly adjusted so that the sizes of the first sub-page and the second sub-page are the same, which facilitates similarity calculation and can reduce calculation errors to a certain extent.

[0052] In another exemplary embodiment, it is further explained how to obtain the compatibility calculation result of the first sub-page based on the first sub-page and the second sub-page of the same size. Figure 4 , Figure 4 is based on Figure 3 The flowchart of another page compatibility test method proposed in the embodiment shown in FIG. The method further includes S410 to S430 in the above S330, which are described in detail as follows:

[0053] S410: performing grayscale processing on the first sub-page and the second sub-page.

[0054] Grayscale processing is to grayscale the color of the sub-page, that is, to adjust the color of the sub-page to gray, white, or black, so as to avoid the influence of the color of the sub-page on the subsequent calculation process.

[0055] S420: Acquire a first pixel value corresponding to the first sub-page after grayscale processing, and a second pixel value corresponding to the second sub-page after grayscale processing.

[0056] The pixel value can be understood as the basic unit of the sub-page. The first pixel value and the second pixel value are both quantifiable values. In this example, the quantifiable pixel values ​​of the corresponding sub-page are used for subsequent compatibility calculations.

[0057] S430: Obtaining a compatibility calculation result of the first sub-page based on the first pixel value and the second pixel value.

[0058] For example, the first pixel value and the second pixel value are subtracted to obtain a difference, and the absolute value of the difference is divided by the first pixel value to obtain a ratio, and the complement of the ratio is used as the similarity result of the first sub-page, that is, the compatibility calculation result of the first sub-page. For example, if the first pixel value is 20 and the second pixel value is 15, then the absolute value of their difference is 5, and the similarity result of the first sub-page is 1-5 / 20=0.75=75%, then the compatibility calculation result of the first sub-page is 75%. The higher the similarity result value, the smaller the difference between the two sub-pages, and the higher the compatibility of the first sub-page; the lower the similarity result value, the larger the difference between the two sub-pages, and the worse the compatibility of the first sub-page.

[0059] This embodiment converts the comparison calculation between subpages into the comparison calculation of pixel values ​​between subpages, that is, converts the subpages into unified and quantifiable values, thereby performing compatibility calculation at the mathematical level, making the calculation process simpler and more feasible.

[0060] In another exemplary embodiment, the second pixel value is a plurality of second pixel values, and the above S430 further includes: Step a to Step b, which are described in detail as follows:

[0061] Step a: Calculate the similarity between the first pixel value and each second pixel value respectively to obtain multiple pixel value compatibility calculation results.

[0062] In this embodiment, there are multiple second pixel values, such as Figure 5 As shown, Figure 5 This is a schematic diagram of another exemplary embodiment of the present application showing a process of calculating the similarity between a first pixel value and each second pixel value. The sub-page to be tested with the same designated identification number is placed in a Floder file, and an identical Floder* file is copied. Pic1 in the Floder file is the first pixel value corresponding to the sub-page to be tested with the designated identification number in the target test page, and Pic2 to Pic4 in the Floder* file are the second pixel values ​​corresponding to the sub-page to be tested with the designated identification number in other pages to be tested. The similarity between the first pixel value and each second pixel value is calculated one by one to obtain the compatibility calculation results of multiple first sub-pages.

[0063] In another exemplary embodiment, pic1 in the Floder file is the first pixel value corresponding to the sub-page to be tested with the specified identification number in the target test page, and pic1 to pic4 in the Floder* file are the second pixel values ​​corresponding to the sub-page to be tested with the specified identification number in other pages to be tested. The similarity of the first pixel value and each second pixel value is calculated one by one to obtain the compatibility calculation results of multiple first sub-pages.

[0064] Step b: Determine the compatibility calculation result of the first sub-page based on the compatibility calculation results of the multiple pixel values.

[0065] Exemplarily, the compatibility calculation results of multiple pixel values ​​are summed and averaged, and the resulting average is determined as the compatibility calculation result for the first sub-page. For example, in step a, there are three second pixel values, and the compatibility calculation results of the three pixel values ​​are 70%, 80%, and 90%. The average of the compatibility calculation results of the three pixel values ​​is 80%, so the compatibility calculation result for the first sub-page is 80%.

[0066] This embodiment further illustrates how to obtain a compatibility calculation result for a first sub-page when the second pixel value is a plurality of second pixel values. The compatibility calculation result for the first sub-page is determined by performing a similarity calculation between the first pixel value and each second pixel value, thereby making the compatibility calculation result for the first sub-page more accurate.

[0067] In another exemplary embodiment, it is further explained how to obtain the compatibility calculation result of the first sub-page according to the first sub-page and the second sub-page of the same size, based on Figure 3 The embodiment shown provides another method for testing the compatibility of a page. The method further includes steps c to d in the above S330, which are described in detail as follows:

[0068] Step c: obtaining a first image histogram corresponding to the first sub-page according to the first sub-page, and obtaining a second image histogram corresponding to the second sub-page according to the second sub-page.

[0069] An image histogram measures the distribution of image pixels. By analyzing pixel distribution, it can be used to treat images that are too bright or too dark. Histogram equalization can also be used to optimize images and improve clarity. Furthermore, due to its low computational cost and numerous advantages, such as invariance to translation, rotation, and scaling, it is widely used in various fields of image processing, particularly in color-based image retrieval and image classification.

[0070] Step d: Based on the first image histogram and the second image histogram, obtain a compatibility calculation result of the first sub-page.

[0071] This embodiment converts the first sub-page and the second sub-page into corresponding image histograms, and compares the correlation between the first image histogram and the second image histogram based on the pixel distribution of the two, calculates the color similarity between the first image histogram and the second image histogram, and thus obtains the compatibility calculation result of the first sub-page.

[0072] In another exemplary embodiment, similarity calculations are performed on the first sub-page and the second sub-page in two dimensions, thereby obtaining a compatibility calculation result of the sub-page to be tested. Figure 6 As shown, Figure 6 This is a schematic diagram of the process of similarity calculation for the first sub-page and the second sub-page shown in another exemplary embodiment of the present application. It includes similarity calculations of the structural dimension and the color dimension; div1 represents the first sub-page, div2 represents the second sub-page, div'1 represents the normalized first sub-page, div'2 represents the normalized second sub-page, div"1 represents the hash value corresponding to the first sub-page or the histogram corresponding to the first sub-page, and div"2 represents the hash value corresponding to the second sub-page or the histogram corresponding to the second sub-page. The structural dimension mainly calculates the hash value of the first sub-page and the second sub-page, thereby calculating the Hamming distance between them, and then obtaining the calculation result of the structural similarity. The color dimension mainly calculates the histogram of the first sub-page and the second sub-page, thereby calculating the correlation between them, and then obtaining the calculation result of the color structure similarity.

[0073] Performing similarity calculation on the first subpage and the second subpage in at least one dimension can increase the accuracy of the similarity calculation process, making the obtained compatibility calculation result of the first subpage more accurate.

[0074] In another exemplary embodiment, based on Figure 3 The page compatibility testing method in the illustrated embodiment also includes step e: based on the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page, determining whether the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem.

[0075] In the pre-processing step, each test page is divided into multiple sub-pages to be tested, each of which is assigned a corresponding identification number. The compatibility calculation result of the sub-page to be tested with a specific identification number can be used to determine whether the test sub-page is a sub-page with a compatibility issue. For example, if the compatibility calculation result for the test sub-page with identification number 1 is 10%, while the compatibility calculation results for the test sub-pages with other identification numbers are all greater than 70%, it is clear that the compatibility calculation result for the sub-page to be tested with identification number 1 in the target test page is small, indicating that the test sub-page has a compatibility issue.

[0076] When performing similarity calculation on the test subpages with designated identification numbers, this embodiment can quickly locate the test subpages with compatibility issues, greatly improve the efficiency of page compatibility testing, and accurately locate the areas of the page with compatibility issues.

[0077] In another exemplary embodiment, Figure 7 is based on Figure 3 The flowchart of another page compatibility testing method proposed in the embodiment shown in FIG. The method includes S310 to S330, step e, and step e also includes S710 to S730, which are described in detail as follows:

[0078] S710: Obtain a relationship test result between a compatibility calculation result of a sub-page to be tested with a specified identification number in a target test page and a preset compatibility threshold.

[0079] The preset compatibility threshold is a pre-set value, which can be any constant. The relationship test results include three characterization results: the compatibility calculation result is less than the preset compatibility threshold, the compatibility calculation result is equal to the preset compatibility threshold, and the compatibility calculation result is greater than the preset compatibility threshold.

[0080] S720: If the relationship test result indicates that the compatibility calculation result is less than a preset compatibility threshold, it is determined that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem.

[0081] For example, the compatibility calculation result of the sub-page to be tested with identification number 3 in the target test page is 30%, and the compatibility calculation result of the sub-page to be tested with identification number 4 is 60%. The preset compatibility threshold is 40%. Since 30% is less than 40%, it is determined that the sub-page to be tested with identification number 3 is the sub-page with compatibility issues.

[0082] S730: If the relationship test result indicates that the compatibility calculation result is greater than or equal to the preset compatibility threshold, it is determined that the sub-page to be tested with the specified identification number in the target test page is not a sub-page with a compatibility problem.

[0083] For example, the compatibility calculation result of the sub-page to be tested with identification number 1 in the target test page is 80%, the compatibility calculation result of the sub-page to be tested with identification number 2 is 40%, and the compatibility calculation result of the sub-page to be tested with identification number 3 is 30%. The preset compatibility threshold is 40%. It is determined that the sub-pages to be tested with identification numbers 1 and 2 are not sub-pages with compatibility issues, and the sub-page to be tested with identification number 3 is a sub-page with compatibility issues.

[0084] The introduction of the preset compatibility threshold in this embodiment can more conveniently and quickly determine whether the sub-page to be tested with the specified identification number in the target test page has a compatibility problem, and the determination process is simpler and more accurate.

[0085] In another exemplary embodiment, based on Figure 7 In the page compatibility testing method proposed in the embodiment shown, if it is determined that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem, such as Figure 8 As shown, Figure 8 is based on Figure 7 The flowchart of another page compatibility testing method proposed in the embodiment shown in FIG. The method further includes S810 to S820, which are described in detail as follows:

[0086] S810: Mark the position in the target test page corresponding to the sub-page where the compatibility problem occurs.

[0087] The marking method includes: marking the sub-pages with compatibility issues with specific colors or special characters, so that the sub-pages are obvious and easy to identify in the entire target test page.

[0088] S820: Send the marked target test page to a preset test device, so that the preset test device adjusts the associated code based on the marked target test page.

[0089] The preset test device has an identification function, which can identify the above-mentioned specific marks, and can lock the position corresponding to the sub-page where the compatibility problem occurs according to the identified mark, so as to adjust the code associated with the target test page to solve the compatibility problem of the mark position.

[0090] This embodiment uses a preset test device to automatically adjust the code associated with the marked target test page without human intervention, automatically triggering the page's compatibility testing process and compatibility problem repair and adjustment process, which is convenient and fast. Through relevant identification positioning, the compatibility testing and repair and adjustment process of the entire page is made more accurate.

[0091] In another exemplary embodiment, based on the page compatibility testing method in each of the above embodiments, a method is provided as follows: Figure 9 The compatibility test method of the page shown, Figure 9 This is a flowchart of another page compatibility testing method shown in another exemplary embodiment of the present application. The method further includes S910 to S930, which are described in detail as follows:

[0092] S910: Acquire multiple page elements in the page to be tested at each resolution.

[0093] Exemplarily, the pages to be tested at various resolutions of the front-end static code (HTML file) are obtained, and the page elements in each page to be tested are scanned and obtained.

[0094] S920: Determine a content page element from the multiple page elements, and determine a parent page element of the content page element.

[0095] Taking the content page element as the base point, lock its parent node upwards, so as to accurately determine the parent page element of the content page element.

[0096] S930: Taking the parent page element as the target object, and obtaining the associated information of the target object.

[0097] The associated information includes data information such as row height and column width of the parent page element. The associated information of the target object can be stored in a global variable. During the compatibility test of subsequent pages, the associated information can be directly obtained from the global variable to divide the test page.

[0098] In another exemplary embodiment, Figure 10 This is a flow chart of another page compatibility testing method shown in another exemplary embodiment of the present application. Based on the page compatibility testing method in each of the above embodiments, the method further includes S1010 to S1020, which are described in detail as follows:

[0099] S1010: Obtaining compatibility calculation results of all sub-pages to be tested with identification numbers in the target test page.

[0100] Exemplarily, the target test page includes sub-pages to be tested with identification numbers 1, 2, and 3, and the compatibility calculation results of the sub-pages to be tested with identification numbers 1, 2, and 3 are obtained.

[0101] S1020: Calculate the average of the compatibility calculation results of all the sub-pages to be tested with identification numbers in the target test page to obtain the compatibility calculation result of the target test page.

[0102] For example, the compatibility calculation result of the sub-page to be tested with identification number 1 in the above S1010 is 70%, the compatibility calculation result of the sub-page to be tested with identification number 2 is 60%, and the compatibility calculation result of the sub-page to be tested with identification number 3 is 80%. The average value of the three is 70%, so the compatibility calculation result of the target test page is 70%.

[0103] The previous step performs a refined similarity calculation process on each sub-page to be tested, so that the compatibility calculation result of each sub-page to be tested is accurate. This embodiment sums and averages the compatibility calculation results of all sub-pages to be tested in the target test page, thereby making the compatibility calculation result of the target test page more accurate.

[0104] In another exemplary embodiment, Figure 11 is based on Figure 10 The flowchart of another page compatibility test method proposed in the embodiment is shown. The method S1010 also includes S1110 to S1120, which are described in detail as follows:

[0105] S1110: Traverse each sub-page to be tested in the target page to be tested.

[0106] For example, the target page to be tested includes three sub-pages to be tested with identification numbers 1, 2, and 3. If the sub-page to be tested with identification number 1 is traversed, it is compared with the sub-page to be tested with identification number 1 in other pages to be tested. This process is repeated until every sub-page to be tested in the target page to be tested is traversed.

[0107] S1120: The traversed sub-page to be tested is used as a target test sub-page, and similarity calculation is performed between the target test sub-page and sub-pages to be tested that match the identification number of the target test sub-page in other pages to be tested, to obtain a compatibility calculation result of the target test sub-page.

[0108] For example, if the sub-page to be tested with identification number 2 is traversed, it is used as the target test sub-page, and similarity calculation is performed on it and the sub-page to be tested with identification number 2 in other pages to be tested, and the compatibility calculation result of the sub-page to be tested with identification number 2 in the target test page is obtained.

[0109] This embodiment further illustrates how to obtain the compatibility calculation results of each sub-page to be tested in the target test page, and traverses them one by one to make the similarity calculation process more accurate, avoiding errors in the calculation objects caused by different identification numbers, and affecting the compatibility calculation results of the target test sub-pages.

[0110] Another aspect of the present application also provides a device for testing the compatibility of a page. Figure 12 As shown, Figure 12 : This is a schematic diagram of a compatibility testing device for a page according to an exemplary embodiment of the present application. The compatibility testing device for a page includes:

[0111] The acquisition module 1210 is configured to acquire association information of target objects contained in at least two pages to be tested;

[0112] The division module 1230 is configured to divide each to-be-tested page based on the associated information of the target object contained in each to-be-tested page, so as to obtain each to-be-tested page comprising a plurality of to-be-tested sub-pages; wherein each to-be-tested sub-page has an identification number;

[0113] The calculation module 1250 is configured to traverse each page to be tested, take the traversed page to be tested as the target test page, and calculate the similarity between the sub-page to be tested with the specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, so as to obtain the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

[0114] In another exemplary embodiment, the calculation module 1250 includes:

[0115] The determining unit is configured to use the sub-page to be tested with the specified identification number in the target test page as the first sub-page, and use the sub-page to be tested with the specified identification number in other pages to be tested as the second sub-page.

[0116] The adjusting unit is configured to adjust the sizes of the first subpage and the second subpage to obtain the first subpage and the second subpage of the same size if it is detected that the size of the first subpage is different from the size of the second subpage.

[0117] The calculation unit is configured to perform similarity calculation on the first sub-page and the second sub-page having the same size, and obtain a compatibility calculation result of the first sub-page.

[0118] In another embodiment, the computing unit comprises:

[0119] The grayscale processing section is configured to perform grayscale processing on the first sub-page and the second sub-page.

[0120] The acquisition section is configured to acquire a first pixel value corresponding to the first sub-page after grayscale processing, and a second pixel value corresponding to the second sub-page after grayscale processing.

[0121] The calculation module is configured to obtain a compatibility calculation result of the first sub-page based on the first pixel value and the second pixel value.

[0122] In another embodiment, the second pixel value is multiple second pixel values; the calculation module is configured to perform similarity calculation on the first pixel value and each second pixel value respectively to obtain multiple pixel value compatibility calculation results; and the compatibility calculation result of the first sub-page is determined based on the multiple pixel value compatibility calculation results.

[0123] In another embodiment, the calculation module 1250 includes:

[0124] The histogram conversion unit is configured to obtain a first image histogram corresponding to the first subpage according to the first subpage, and to obtain a second image histogram corresponding to the second subpage according to the second subpage.

[0125] The histogram calculation unit is configured to obtain a compatibility calculation result of the first sub-page based on the first image histogram and the second image histogram.

[0126] In another embodiment, the page compatibility testing device further includes:

[0127] The determination module is configured to determine whether the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem based on the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

[0128] In another embodiment, the determining module includes:

[0129] The threshold comparison unit is configured to obtain a relationship test result between a compatibility calculation result of a sub-page to be tested with a specified identification number in a target test page and a preset compatibility threshold; if the relationship test result indicates that the compatibility calculation result is less than the preset compatibility threshold, it is determined that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem; if the relationship test result indicates that the compatibility calculation result is greater than or equal to the preset compatibility threshold, it is determined that the sub-page to be tested with the specified identification number in the target test page is not a sub-page with a compatibility problem.

[0130] In another embodiment, if it is determined that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem, the page compatibility testing device further includes:

[0131] The marking module is configured to mark the position corresponding to the sub-page where the compatibility problem occurs in the target test page.

[0132] The adjustment module is configured to send the marked target test page to a preset test device, so that the preset test device adjusts the associated code based on the marked target test page.

[0133] In another embodiment, the acquisition module 1210 includes:

[0134] The page element acquisition unit is configured to acquire multiple page elements in the page to be tested at each resolution.

[0135] The parent page element determining unit is configured to determine a content page element from a plurality of page elements, and determine a parent page element of the content page element.

[0136] The associated information acquisition unit is configured to take the parent page element as a target object and acquire associated information of the target object.

[0137] In another embodiment, the page compatibility testing device further includes:

[0138] The compatibility calculation result acquisition module for the sub-pages to be tested is configured to acquire the compatibility calculation results of all the sub-pages to be tested with identification serial numbers in the target test page.

[0139] The compatibility calculation module of the target test page is configured to calculate the average value of the compatibility calculation results of all the sub-pages to be tested with identification numbers in the target test page to obtain the compatibility calculation result of the target test page.

[0140] In another embodiment, the compatibility calculation module of the target test page is configured to traverse each sub-page to be tested in the target test page; use the traversed sub-page to be tested as the target test sub-page, and perform similarity calculation on the target test sub-page and the sub-page to be tested in other pages to be tested that matches the identification number of the target test sub-page to obtain the compatibility calculation result of the target test sub-page.

[0141] It should be noted that the page compatibility testing device provided in the above embodiment and the page compatibility testing method provided in the above embodiment belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0142] See also Figure 13 , Figure 13 1 is a schematic diagram of an implementation environment involved in this application, which includes a terminal 100 and a server 200, and the terminal 100 and the server 200 communicate with each other via a wired or wireless network.

[0143] Terminal 100 is used to send page compatibility test requests and receive compatibility calculation results. Terminal 100 includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, and in-vehicle terminals. It can be any electronic device capable of image visualization, such as a smartphone, tablet, laptop, or computer, and is not limited here.

[0144] like Figure 13As shown, the server 200 is placed at the background processing end, and can execute the page compatibility testing method in each of the above embodiments. The user request is transmitted to the background front end through the terminal 100, wherein the user request includes a static page request. After receiving the static page request, the background front end returns the static file to the terminal 100, and at the same time initiates a page compatibility test request to the background server 200. The API interface layer in the background server 200 receives the page compatibility test request sent by the terminal 100, and passes the URL, etc. to the screenshot module. The screenshot module takes screenshots of the test page at different resolutions to obtain multiple pages to be tested at different resolutions, and then returns the screenshot test page to the API interface layer. The API interface layer transmits the screenshot test page to the compatibility calculation module, thereby obtaining the associated information of the target object contained in the page to be tested at different resolutions, and based on the associated information of the target object contained in each page to be tested, divides each page to be tested to obtain each page to be tested containing multiple sub-pages to be tested. Traverse each page to be tested, use the traversed page to be tested as the target test page, and perform similarity calculation on the sub-page to be tested with the specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested, and obtain the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page. Specifically, the compatibility calculation module returns the compatibility calculation result to the API interface layer, and can also store the compatibility calculation result in a database in the server 200 or a database independent of the server 200. The API interface layer transmits the compatibility calculation result to the backend front end, which renders the data and then transmits it to the terminal 100.

[0145] In addition, the compatibility calculation module in server 200 can also calculate the compatibility calculation results of all sub-pages to be tested with identification numbers in the target test page, thereby determining the compatibility calculation results of the target test page, and can also calculate the compatibility calculation results of the pages to be tested at each resolution.

[0146] Server 200 can be an independent physical server or a server cluster or distributed system composed of multiple physical servers, where multiple servers can form a blockchain, and the server is a node on the blockchain. Server 200 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and this is not restricted here.

[0147] See also Figure 14 , Figure 14It is a schematic diagram of another implementation environment involved in this application. Among them, the server 200 includes a backend front end, an API interface layer, a compatibility calculation module, a screenshot module and a database. The terminal 100 sends a request to the API interface layer in the server 200, and the screenshot module takes screenshots of the test page at different resolutions to obtain multiple test pages at different resolutions, and then returns the screenshot test page to the API interface layer. The API interface layer transmits the screenshot test page to the compatibility calculation module, and the compatibility calculation module obtains the associated information of the target objects contained in the test page at different resolutions; based on the associated information of the target objects contained in each test page, each test page is divided to obtain each test page containing multiple test sub-pages; wherein each test sub-page has an identification number; each test page is traversed, and the traversed test page is used as the target test page, and the test sub-page with the specified identification number in the target test page is similarly calculated with the test sub-page with the specified identification number in other test pages to obtain the compatibility calculation result of the test sub-page with the specified identification number in the target test page. The compatibility calculation module transmits the compatibility calculation results to the API interface layer and stores the compatibility calculation results in the database.

[0148] Another aspect of the present application provides an electronic device, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above method is executed.

[0149] See also Figure 15 , Figure 15 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.

[0150] It should be noted that Figure 15 The computer system 1500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0151] like Figure 15As shown, computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 1502 or programs loaded from storage unit 1508 into random access memory (RAM) 1503, such as executing the methods in the above embodiments. Various programs and data required for system operation are also stored in RAM 1503. CPU 1501, ROM 1502, and RAM 1503 are connected to each other via bus 1504. Input / output (I / O) interface 1505 is also connected to bus 1504.

[0152] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, and the like; an output section 1507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1508 including a hard disk; and a communication section 1509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. Removable media 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1510 as needed, so that computer programs read from the removable media can be installed in the storage section 1508 as needed.

[0153] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1509, and / or installed from a removable medium 1511. When the computer program is executed by the central processing unit (CPU) 1501, the various functions defined in the system of the present application are executed.

[0154] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a 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. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0155] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0156] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0157] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the aforementioned page compatibility testing method. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.

[0158] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the page compatibility testing method provided in each of the above embodiments.

[0159] According to one aspect of an embodiment of the present application, a computer system is further provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0160] The following components are connected to the I / O interface: an input section including a keyboard, mouse, etc.; an output section including a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section including a hard disk; and a communication section including a network interface card such as a LAN (Local Area Network) card and a modem. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc. are installed in the drive as needed so that computer programs read from them can be installed into the storage section as needed.

[0161] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main ideas and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for testing compatibility of a page, characterized in that: include: Obtaining association information of target objects contained in at least two pages to be tested, where different pages to be tested are pages with the same content at different resolutions, and the association information of the target objects is used to indicate the position and size of the target objects in the corresponding pages to be tested; Based on the associated information of the target object contained in each page to be tested, each page to be tested is divided to obtain each page to be tested including multiple sub-pages to be tested; wherein each sub-page to be tested includes a corresponding target object with an identification number; Traversing each to-be-tested page, taking the traversed to-be-tested page as a target test page, and performing similarity calculation on a to-be-tested sub-page with a specified identification number in the target test page and a to-be-tested sub-page with the specified identification number in other to-be-tested pages, to obtain a compatibility calculation result of the to-be-tested sub-page with the specified identification number in the target test page, wherein the compatibility calculation result is a similarity calculation result; Based on the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page, it is determined whether the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem.

2. The method according to claim 1, characterized in that The similarity calculation of the sub-page to be tested with the specified identification number in the target test page and the sub-page to be tested with the specified identification number in other pages to be tested to obtain a compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page includes: Using the sub-page to be tested with the specified identification number in the target test page as the first sub-page, and using the sub-page to be tested with the specified identification number in the other pages to be tested as the second sub-page; If it is detected that the size of the first subpage is different from the size of the second subpage, the sizes of the first subpage and the second subpage are adjusted to obtain a first subpage and a second subpage of the same size; Similarity calculation is performed on the first sub-page and the second sub-page having the same size to obtain a compatibility calculation result of the first sub-page.

3. The method according to claim 2, characterized in that The performing similarity calculation on the first sub-page and the second sub-page having the same size to obtain a compatibility calculation result of the first sub-page includes: performing grayscale processing on the first sub-page and the second sub-page; Acquire a first pixel value corresponding to the first sub-page after grayscale processing, and a second pixel value corresponding to the second sub-page after grayscale processing; A compatibility calculation result of the first sub-page is obtained based on the first pixel value and the second pixel value.

4. The method according to claim 3, characterized in that The second pixel value is a plurality of second pixel values; and obtaining a compatibility calculation result of the first sub-page based on the first pixel value and the second pixel value includes: Performing similarity calculation on the first pixel value and each second pixel value respectively to obtain multiple pixel value compatibility calculation results; A compatibility calculation result of the first sub-page is determined based on the compatibility calculation results of the multiple pixel values.

5. The method according to claim 2, characterized in that The performing similarity calculation on the first sub-page and the second sub-page having the same size to obtain a compatibility calculation result of the first sub-page includes: Obtaining a first image histogram corresponding to the first sub-page according to the first sub-page, and obtaining a second image histogram corresponding to the second sub-page according to the second sub-page; A compatibility calculation result of the first sub-page is obtained based on the first image histogram and the second image histogram.

6. The method according to claim 1, characterized in that The determining, based on the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page, whether the sub-page to be tested with the specified identification number in the target test page is a sub-page having a compatibility problem includes: Obtaining a relationship test result between a compatibility calculation result of a sub-page to be tested with a specified identification number in the target test page and a preset compatibility threshold; If the relationship test result indicates that the compatibility calculation result is less than the preset compatibility threshold, determining that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem; If the relationship test result indicates that the compatibility calculation result is greater than or equal to the preset compatibility threshold, it is determined that the sub-page to be tested with the specified identification number in the target test page is not a sub-page with a compatibility problem.

7. The method according to claim 6, characterized in that If it is determined that the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem, the method further includes: Marking a position in the target test page corresponding to the sub-page where the compatibility issue occurs; The marked target test page is sent to a preset test device, so that the preset test device adjusts the associated code based on the marked target test page.

8. The method according to any one of claims 1 to 7, characterized in that The step of obtaining association information of target objects contained in at least two pages to be tested includes: Get multiple page elements in the page to be tested at each resolution; Determining a content page element from the plurality of page elements, and determining a parent page element of the content page element; The parent page element is used as a target object, and associated information of the target object is obtained.

9. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Obtaining compatibility calculation results of all sub-pages to be tested with identification numbers in the target test page; The compatibility calculation results of all the sub-pages to be tested with identification numbers in the target test page are averaged to obtain the compatibility calculation result of the target test page.

10. The method according to claim 9, characterized in that The obtaining of the compatibility calculation results of all sub-pages to be tested with identification numbers in the target test page includes: Traversing each sub-page to be tested in the target test page; The traversed sub-page to be tested is used as the target test sub-page, and similarity calculation is performed between the target test sub-page and the sub-page to be tested that matches the identification number of the target test sub-page in other pages to be tested to obtain a compatibility calculation result of the target test sub-page.

11. A device for testing compatibility of a page, characterized in that: include: an acquisition module configured to acquire association information of a target object contained in at least two pages to be tested, where different pages to be tested are pages with the same content at different resolutions, and the association information of the target object is used to indicate the position and size of the target object in the corresponding pages to be tested; a partitioning module configured to partition each to-be-tested page based on associated information of the target object contained in each to-be-tested page, to obtain each to-be-tested page comprising a plurality of to-be-tested sub-pages; wherein each to-be-tested sub-page comprises a corresponding target object having an identification number; a calculation module configured to traverse each to-be-tested page, and use the traversed to-be-tested page as a target test page, perform similarity calculation on a to-be-tested subpage with a specified identification number in the target test page and a to-be-tested subpage with the specified identification number in other to-be-tested pages, and obtain a compatibility calculation result of the to-be-tested subpage with the specified identification number in the target test page, wherein the compatibility calculation result is a similarity calculation result; The determination module is configured to determine whether the sub-page to be tested with the specified identification number in the target test page is a sub-page with a compatibility problem based on the compatibility calculation result of the sub-page to be tested with the specified identification number in the target test page.

12. An electronic device, characterized in that: include: Controller; The memory is used to store one or more programs, and when the one or more programs are executed by the controller, the controller implements the page compatibility testing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the page compatibility testing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Webpage testing method and webpage testing device

    CN103853656A

  • Compatibility testing method and device

    CN113506291A