Page detection method and device, electronic equipment and storage medium

By automating the execution of action chains in a smart home system and simulating user operation paths, the problem of inconsistent data combination rules on the terminal interface is solved, achieving efficient page consistency verification.

CN120872809APending Publication Date: 2025-10-31GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510824744.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In smart home systems, the development of each terminal interface is handled by different teams, leading to inconsistent data combination rules and conflicting calculation logic. Existing automated testing requires exhaustive coverage, resulting in a surge in the number of test cases, high costs, and low efficiency.

Method used

By automating the execution of action chains, the system simulates the user's actual operation path and performs consistency checks across pages. This includes obtaining the target page text, determining field instances and consistency rules, constructing action chains, and performing consistency checks.

Benefits of technology

It improves the accuracy and efficiency of page consistency checks, avoids the surge in the number of test cases caused by exhaustive coverage, and enables consistency checks across pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120872809A_ABST
    Figure CN120872809A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a page detection method and device, electronic equipment and a storage medium, consistency check, namely static consistency check, is carried out on a field instance corresponding to a first text, then after an action chain is executed, a second text is extracted from a target page corresponding to the action chain, and the second text is extracted from the target page. According to the page consistency detection method and device, the target page is subjected to static consistency detection, the field instance corresponding to the second text is subjected to consistency detection, namely, dynamic consistency detection, the target page is subjected to dynamic consistency detection by executing the action chain, the page consistency detection accuracy is improved, and the page consistency detection efficiency is improved. Through a mode of automatically executing the action chain, the actual operation path of the user is simulated, consistency checking can be carried out in a cross-page mode, the test efficiency is improved, and the problem that the number of test cases is increased due to exhaustive coverage of all possible data combination states is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for detecting pages. Background Technology

[0002] In the daily use of smart home systems, the same underlying data needs to be dynamically combined with different related data on different terminal interfaces to present differentiated display effects. Taking device power consumption data as an example, on the overall overview page, it needs to be compared and analyzed horizontally with the power consumption data of other devices; on the device details page, it needs to be combined with the energy-saving coefficient to calculate the energy efficiency assessment value; and on the home control screen, it needs to be linked with the carbon emission reduction coefficient to be converted into an environmental benefit indicator. Similarly, when consumable price data is displayed on different sales channels, it will be combined and calculated in real time with various promotional activities (such as limited-time discounts, member-exclusive prices, and discounts for purchases over a certain amount), and the price presented to the user may vary significantly depending on the display scenario.

[0003] Since the development of various terminal interfaces is usually carried out by different teams and involves data processing logic from multiple business lines, problems such as inconsistent data combination rules and conflicting calculation logic can easily arise. Therefore, it is necessary to test the consistency of multi-page display. However, existing automated testing requires exhaustive coverage of all possible data combination states, which leads to a surge in the number of test cases, resulting in high costs and low efficiency. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a page detection method, apparatus, electronic device, and storage medium that overcomes or at least partially solves the above problems.

[0005] To address the above problems, this invention discloses a page detection method, the method comprising:

[0006] Obtain the target page and extract the first text from the target page;

[0007] Determine the field instance corresponding to the first text, wherein the field instance includes the field name and field information;

[0008] Identify the field instances that satisfy the consistency rules;

[0009] Among the field instances that satisfy the consistency rules, determine the field instances related to the preset action, and respond with the expected field information after executing the preset action;

[0010] Construct an action chain, the action chain including the preset action;

[0011] After executing the action chain, the target page corresponding to the action chain is determined; the second text is extracted from the target page corresponding to the action chain, and the field instance corresponding to the second text is determined; a consistency check is performed based on the field instance corresponding to the second text and the corresponding expected field information.

[0012] Optionally, determining the field instance corresponding to the first text includes:

[0013] Construct a field model, which includes a preset field name, a field matching rule corresponding to the preset field name, and a field information extraction rule;

[0014] Determine the target field name in the first text that matches the field matching rule;

[0015] According to the field information extraction rules, extract the field information corresponding to the target field name in the first text.

[0016] Optionally, the field model further includes field consistency rules, and determining the field instances that satisfy the consistency rules includes:

[0017] For numerical field information, determine whether the field value of the field information is consistent with the calculation logic indicated by the field consistency rule;

[0018] For text-based field information, determine whether the textual semantics of the field information are consistent with the semantics indicated by the field consistency rule.

[0019] Optionally, the field model further includes field refresh behavior and field information calculation rules. The step of determining the field instance related to the preset action among the field instances that satisfy the consistency rules, and responding with the expected field information after executing the preset action, includes:

[0020] According to the event that responds to refreshing the preset field indicated by the field refresh behavior, among the field instances that satisfy the consistency rule, determine the field instance related to the preset action;

[0021] Based on the field information calculation rules, determine the field instance related to the preset action, and respond with the expected field information after executing the preset action.

[0022] Optionally, the construction of the field model includes:

[0023] Extract the third text and the corresponding feature values ​​from the target page;

[0024] Obtain the design prototype document, determine the preset fields corresponding to the third text based on the third text, the feature values, and the design prototype document, and construct the field model corresponding to the preset fields.

[0025] Optionally, extracting the first text from the target page includes:

[0026] Identify the target region from the target page;

[0027] Extract the first text from the target area.

[0028] Optionally, determining the field instance corresponding to the second text includes:

[0029] Determine the target field name in the second text that matches the field matching rule;

[0030] According to the field information extraction rules, extract the field information corresponding to the target field name in the second text;

[0031] The method further includes:

[0032] If there is no target field name in the second text that matches the field matching rule, then the prototype design document of the page corresponding to the second text is determined, the field name corresponding to the second text and the corresponding field model information are determined according to the prototype design document, and the field model information is added to the field model.

[0033] Accordingly, embodiments of the present invention disclose a page detection device.

[0034] The first text determination module is used to obtain a target page and extract first text from the target page;

[0035] The first field instance determination module is used to determine the field instance corresponding to the first text, wherein the field instance includes a field name and field information;

[0036] The first consistency determination module is used to determine the field instances that satisfy the consistency rules;

[0037] The expected field information determination module is used to determine the field instance related to the preset action among the field instances that satisfy the consistency rule, and respond with the expected field information after the preset action is executed;

[0038] An action chain construction module is used to construct an action chain, wherein the action chain includes the preset action;

[0039] The second consistency verification module is used to determine the target page corresponding to the action chain after the action chain is executed; extract the second text from the target page corresponding to the action chain and determine the field instance corresponding to the second text; and perform consistency verification based on the field instance corresponding to the second text and the corresponding expected field information.

[0040] Optionally, the first field instance determination module includes:

[0041] The field model construction submodule is used to construct a field model, which includes a preset field name, a field matching rule corresponding to the preset field name, and a field information extraction rule.

[0042] The first target field name determination submodule is used to determine the target field name in the first text that matches the field matching rule;

[0043] The first field information determination submodule is used to extract the field information corresponding to the target field name in the first text according to the field information extraction rules.

[0044] Optionally, the field model further includes field consistency rules, and the first consistency determination module includes:

[0045] The calculation logic consistency determination submodule is used to determine whether the field value of numeric field information is consistent with the calculation logic indicated by the field consistency rule.

[0046] The semantic consistency determination submodule is used to determine whether the text semantics of text-type field information are consistent with the semantics indicated by the field consistency rule.

[0047] Optionally, the field model further includes field refresh behavior and field information calculation rules, and the expected field information determination module includes:

[0048] The related field instance determination submodule is used to determine the field instance related to the preset action from the field instance that satisfies the consistency rule, based on the event that is refreshed according to the preset field indicated by the field refresh behavior.

[0049] The expected field information determination submodule is used to determine the field instance related to the preset action according to the field information calculation rules, and respond with the expected field information after the preset action is executed.

[0050] Optionally, the field model construction submodule includes:

[0051] The third text extraction unit is used to extract third text and the feature value corresponding to the third text from the target page;

[0052] The field model construction unit is used to obtain the design prototype document, determine the preset field corresponding to the third text based on the third text, the feature value and the design prototype document, and construct the field model corresponding to the preset field.

[0053] Optionally, the first text determination module includes:

[0054] The target region identification submodule is used to identify the target region from the target page;

[0055] The first text extraction submodule is used to extract the first text from the target area.

[0056] Optionally, the second consistency verification module includes:

[0057] The second target field name submodule is used to determine the target field name in the second text that matches the field matching rule;

[0058] The second field information extraction submodule is used to extract the field information corresponding to the target field name in the second text according to the field information extraction rules.

[0059] The device further includes:

[0060] The field model update module is used to determine the prototype design document of the page corresponding to the second text if there is no target field name in the second text that matches the field matching rule, determine the field name and the corresponding field model information corresponding to the second text according to the prototype design document, and add the field model information to the field model.

[0061] Accordingly, this invention discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various steps of the above-described page detection method embodiments.

[0062] Accordingly, embodiments of the present invention disclose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the various steps of the above-described page detection method embodiments.

[0063] The embodiments of the present invention have the following advantages:

[0064] An embodiment of the present invention provides a page detection method, which includes: acquiring a target page; extracting first text from the target page; determining field instances corresponding to the first text, each field instance including a field name and field information; determining field instances that satisfy consistency rules; among the field instances that satisfy the consistency rules, determining field instances related to a preset action, and responding with expected field information after executing the preset action; constructing an action chain, the action chain including a preset action; after executing the action chain, determining the target page corresponding to the action chain; extracting second text from the target page corresponding to the action chain, and determining the field instances corresponding to the second text; and performing consistency verification based on the field instances corresponding to the second text and the corresponding expected field information. This invention first performs a consistency check on the field instances corresponding to the first text, i.e., a static consistency check. Then, after executing the action chain, it extracts the second text from the target page corresponding to the action chain and performs a consistency check on the field instances corresponding to the second text, i.e., a dynamic consistency check. This detection method, which performs a static consistency check on the target page and a dynamic consistency check on the target page by executing the action chain, improves the accuracy of page consistency checks. Moreover, by automating the execution of the action chain, it simulates the user's actual operation path, enabling consistency checks across pages, improving testing efficiency, and avoiding the problem of a surge in the number of test cases caused by exhaustive coverage of all possible data combination states. Attached Figure Description

[0065] Figure 1 This is a flowchart of a page detection method according to an embodiment of the present invention;

[0066] Figure 2 This is a structural block diagram of a page detection device according to an embodiment of the present invention. Detailed Implementation

[0067] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0068] In the daily use of smart home systems, the same underlying data needs to be dynamically combined with different related data on different terminal interfaces to present differentiated display effects. Taking device power consumption data as an example, on the overall overview page, it needs to be compared and analyzed horizontally with the power consumption data of other devices; on the device details page, it needs to be combined with the energy-saving coefficient to calculate the energy efficiency assessment value; and on the home control screen, it needs to be linked with the carbon emission reduction coefficient to be converted into an environmental benefit indicator. Similarly, when consumable price data is displayed on different sales channels, it will be combined and calculated in real time with various promotional activities (such as limited-time discounts, member-exclusive prices, and discounts for purchases over a certain amount), and the price presented to the user may vary significantly depending on the display scenario.

[0069] Since the development of various terminal interfaces is usually carried out by different teams and involves data processing logic from multiple business lines, problems such as inconsistent data combination rules and conflicting calculation logic can easily arise. Therefore, it is necessary to test the consistency of multi-page display. However, existing automated testing requires exhaustive coverage of all possible data combination states, which leads to a surge in the number of test cases, resulting in high costs and low efficiency.

[0070] One of the core concepts of this invention is that by automating the execution of action chains, the actual user operation path can be simulated, enabling consistency checks across pages, improving testing efficiency, and avoiding the problem of a surge in the number of test cases caused by exhaustive coverage of all possible data combinations.

[0071] Reference Figure 1 The diagram illustrates a flowchart of a page detection method according to an embodiment of the present invention, which may specifically include the following steps:

[0072] Step 101: Obtain the target page and extract the first text from the target page.

[0073] In daily smart home use, the platform continuously gathers multi-dimensional data from the cloud, including user behavior, device status, and environmental awareness. This data supports diverse business functions, such as order management and personalized recommendations, to enhance the user experience. To meet the needs of different roles and usage scenarios, the platform outputs this business data to multiple terminals, including a mobile app, a PC client, a web interface, and a backend big data dashboard. However, due to differences in display methods, interaction logic, and data processing flows across these terminals, inconsistencies in cross-platform display are prone to occur. Therefore, automated detection of multi-page consistency is necessary.

[0074] The target page is the page that needs to be consistent. The target page can be divided into two types. The first type is a page that displays similar data but has a different UI (User Interface). This type of page displays the same or highly related core business data in different interfaces, but due to different user roles, usage scenarios, and interaction requirements, its UI layout, control form, and display level are different. For example, card list page and device details page. Card list page is used to display the status thumbnails of multiple devices on the App homepage, that is, to display summary data information. Device details page is a detailed control panel entered after clicking on a device, that is, to display full data information.

[0075] The second type uses the same data but processes it differently to generate different displayed data. These pages are based on the same original data source, but present data results from different dimensions and perspectives through different data processing logics, aggregation methods, unit conversions, and semantic interpretations. Although the data is essentially the same, the presentation and meaning are different. For example, the electricity statistics page displays the electricity consumption for the month, with the data source being the original electricity consumption data (kWh), and is displayed as "Cumulative electricity consumption this month: 120kWh," with the calculation logic being a direct display of the original value; the environmental contribution page displays the carbon emission savings, also with the data source being the original electricity consumption data, and is displayed as "equivalent to a reduction of 60kg of carbon dioxide emissions," with the calculation logic being electricity consumption multiplied by a carbon emission coefficient.

[0076] Image recognition algorithms can be used to analyze images from multiple pages, identifying corresponding UI features, text and data distribution patterns, and overall page information density to determine the page type and thus identify multiple target pages. UI features refer to the layout and style characteristics of visible elements on the page, such as control types (buttons, input boxes, icons, images, etc.), control positions (coordinates, hierarchy, alignment), colors, fonts, borders, backgrounds, and other style attributes. Text and data distribution patterns refer to the organization and distribution of text content on the page, such as whether text is concentrated in one area (e.g., a details page), whether there are numerous tables or list items (e.g., data tables in an admin panel), or whether it uses a card-style arrangement (e.g., a product list page). This distribution pattern reflects the page's functional intent. Overall page information density refers to the amount of information contained within a unit area. High information density means dense page content, many controls, a lot of text, and many interactive points (e.g., a management system); low information density means a simple page with ample white space and a focus on key information (e.g., a homepage or onboarding page).

[0077] After obtaining the target page, the first text is extracted from the target page. For example, readable text content, such as numbers, letters, and Chinese characters, can be automatically identified and extracted from the target page using OCR (Optical Character Recognition) technology.

[0078] Step 102: Determine the field instance corresponding to the first text. The field instance includes the field name and field information.

[0079] After extracting the first text from the target page, the field instance corresponding to the first text is determined. The field instance includes multiple field names and field information corresponding to each field name. The field information can be a field value, which refers to the specific value that a field has at a specific time. For example, the field value can be a numeric type (such as 85%, 20) or a string type (such as "Available", "Not Available", "Sufficient Stock", "Sold Out").

[0080] Step 103: Determine the field instances that satisfy the consistency rules.

[0081] After determining the field instance corresponding to the first text, a consistency check is performed on the field instance to identify those that satisfy the consistency rules. Consistency checks are typically used to check: whether the values ​​of the same field are consistent across different pages; whether the calculation relationships between multiple fields are reasonable; whether data updates match expected changes; and whether the semantics of the same field are consistent across different pages. For example, if the field instance includes three fields: original price, discount, and current price, with field information of ¥100, 20% off, and ¥79 respectively, then the expected current price should be 100 × 0.8 = ¥80. However, the actual current price is ¥79, indicating that the current price does not satisfy the consistency rules.

[0082] A consistency check is performed on the field instance corresponding to the first text. Since no action is performed to update the data, it is essentially a static consistency check, which determines whether the field instance obtained from the target page meets the consistency rules.

[0083] Step 104: Among the field instances that satisfy the consistency rules, determine the field instances related to the preset action and respond with the expected field information after executing the preset action.

[0084] Preset actions can be to change the operating state of a device or system, such as turning the living room lights on / off, starting / stopping the air conditioner, or setting a device to "offline". They can also be to configure a preset scene that is completed collaboratively by multiple devices, such as setting a "homecoming mode" (turning on lights, opening curtains, and adjusting the air conditioner temperature) or a "sleep mode" (turning off lights, activating security, and lowering the volume). They can also be to apply configured rules, policies, and parameters to the system and observe their effects, such as enabling scheduled tasks (e.g., automatically opening windows at 7 a.m. every day), applying energy-saving modes (restricting the operation of certain high-power-consuming devices), or even placing an order on a product page.

[0085] If a preset action is executed, the field information related to the preset action will change. For example, if the preset action is to place an order for 1 item of a certain product, the field related to the order action includes inventory. The inventory will be reduced by 1 from the inventory quantity before the order is placed. If the inventory quantity before the order is 50, the expected field information of the inventory field related to the order action after the order action is executed will be 49.

[0086] Among the field instances that satisfy the consistency rules, determine the field instances related to the preset action, and respond with the expected field information after executing the preset action. Since the field instance corresponding to the first text satisfies the consistency rules, the expected field information determined therefrom is also correct.

[0087] Step 105: Construct an action chain, which includes preset actions.

[0088] Refresh actions between different target pages, including their sequence, are packaged into corresponding action chains. In the UI operation flow, users switch between multiple pages and trigger various refresh behaviors (such as clicking, typing, and submitting). These refresh actions have a certain sequence and causal relationship. These actions can be combined to form a structured, executable action chain. The action chain includes preset actions.

[0089] Step 106: After executing the action chain, determine the target page corresponding to the action chain; extract the second text from the target page corresponding to the action chain, and determine the field instance corresponding to the second text; perform consistency verification based on the field instance corresponding to the second text and the corresponding expected field information.

[0090] After constructing the action chain, the action chain is executed automatically, and the target page corresponding to each action in the action chain is determined. Since the display information of the target page will change after the action chain is executed, it is necessary to perform a consistency check on the target page corresponding to each action in the action chain after execution. That is, after the static consistency check passes, a dynamic consistency check is performed.

[0091] After executing the action chain, the second text is extracted from the target page corresponding to the action chain, and the field instance corresponding to the second text is determined. Based on the field instance corresponding to the second text and the corresponding expected field information, a consistency check is performed. For example, if the action chain includes the operation of placing an order, the field instance corresponding to the second text includes inventory and the corresponding field information 49. The expected field information corresponding to inventory is 49. Therefore, it can be determined that the inventory field has passed the consistency check.

[0092] An embodiment of the present invention provides a page detection method, which includes: acquiring a target page; extracting first text from the target page; determining field instances corresponding to the first text, each field instance including a field name and field information; determining field instances that satisfy consistency rules; among the field instances that satisfy the consistency rules, determining field instances related to a preset action, and responding with expected field information after executing the preset action; constructing an action chain, the action chain including a preset action; after executing the action chain, determining the target page corresponding to the action chain; extracting second text from the target page corresponding to the action chain, and determining the field instances corresponding to the second text; and performing consistency verification based on the field instances corresponding to the second text and the corresponding expected field information. This invention first performs a consistency check on the field instances corresponding to the first text, i.e., a static consistency check. Then, after executing the action chain, it extracts the second text from the target page corresponding to the action chain and performs a consistency check on the field instances corresponding to the second text, i.e., a dynamic consistency check. This detection method, which performs a static consistency check on the target page and a dynamic consistency check on the target page by executing the action chain, improves the accuracy of page consistency checks. Moreover, by automating the execution of the action chain, it simulates the user's actual operation path, enabling consistency checks across pages, improving testing efficiency, and avoiding the problem of a surge in the number of test cases caused by exhaustive coverage of all possible data combination states.

[0093] In this embodiment of the invention, step 102 involves determining the field instance corresponding to the first text. The field instance includes the field name and field information, and may specifically include the following sub-steps:

[0094] Sub-step S11: Construct a field model, which includes preset field names, field matching rules corresponding to the preset field names, and field information extraction rules.

[0095] Sub-step S12: Determine the target field name in the first text that matches the field matching rule;

[0096] Sub-step S13: Extract the field information corresponding to the target field name in the first text according to the field information extraction rules.

[0097] A field model is the process of abstractly modeling the definitions, types, constraints, and semantics of each field in a data structure. Constructing a field model involves creating a set of predefined field names, corresponding field matching rules for each field name, and field information extraction rules. Field matching rules can be regular expressions or keywords. These rules determine the field names corresponding to the text, while field information extraction rules instruct how to extract the corresponding field information from the text.

[0098] The first text is matched against the field matching rules. If a match is successful, the target field name corresponding to the first text is determined to be the preset field name corresponding to the successfully matched field matching rule. After determining the target field name corresponding to the first text, the field information extraction rules corresponding to the target field name are determined according to the field information extraction rules corresponding to the preset field names in the field model. Based on the field information extraction rules corresponding to the target field name, field information is extracted from the first text corresponding to the target field name. This method of determining the field instance corresponding to the first text through the field model ensures that the first text is transformed and extracted according to the predefined standard, i.e., according to the field model, to obtain the field instance. This standardized processing method can improve the accuracy of data processing, facilitate subsequent automated processing, transform complex business logic into specific field models, help to clearly express business requirements, and improve processing efficiency.

[0099] In this embodiment of the invention, the field model further includes field consistency rules. Step 103 involves determining field instances that satisfy the consistency rules, which may specifically include the following sub-steps:

[0100] Sub-step S21: For numeric field information, determine whether the field value of the field information is consistent with the calculation logic indicated by the field consistency rule.

[0101] Sub-step S22: For text-type field information, determine whether the text semantics of the field information are consistent with the semantics indicated by the field consistency rules.

[0102] Consistency rules include consistency of numerical logical type validation and consistency of semantic type validation. Numerical logical type validation involves judging the consistency and reasonableness of quantifiable fields such as numbers, amounts, times, and percentages on the target page. This type of validation is typically used to check: whether the values ​​of the same field are consistent across different pages, whether the calculation relationships between multiple fields are reasonable, and whether data updates match expected changes. For example, price consistency: if the homepage displays ¥99, it should also be ¥99 on the details page and the order page; discount logic correctness: if the original price is ¥100, with an 80% discount, the current price should be ¥80; percentage conversion: if the battery is 70%, the actual mAh capacity should be 2100mAh (based on battery capacity); quantity synchronization: if the quantity in the shopping cart is 3, it should also be 3 on the checkout page.

[0103] Semantic type validation involves determining the semantic consistency of non-numeric fields on a target page. It primarily focuses on whether the natural language expression of the fields is consistent, whether the semantics are consistent, and whether there is a logical connection. This type of validation is typically used to check: whether the description of the same field is consistent across different pages (e.g., "Sufficient stock" or "In stock"); whether product categories, tags, and statuses are consistent; and whether the copywriting style is consistent (e.g., "Shipped" or "In transit"). For example, consistent product categories: the list page displays "Smart Devices," while the details page displays "Mobile Phones"; consistent inventory status: the homepage displays "In stock," the details page displays "In stock," and the order page displays "Available for purchase"; and consistent order status: the PC displays "Shipped," while the App displays "In transit."

[0104] The field model also includes predefined field consistency rules for each field. Based on these predefined field consistency rules, the field consistency rules for each field in the field instance are determined. Then, based on these field consistency rules, the field information in the field instance is judged for consistency. For numeric field information (here, numeric field information refers to numeric type field information), a numeric logic type check is performed to determine whether the field value is consistent with the calculation logic indicated by the field consistency rules. For text field information, a semantic type check is performed to determine whether the text semantics of the field information are consistent with the semantics indicated by the field consistency rules.

[0105] Different consistency checks are performed based on different field information types, which improves the accuracy of consistency checks. Furthermore, consistency checks are performed on the field instances corresponding to the first text, i.e., static checks, which are consistency checks performed without triggering user behavior or business actions. This allows errors to be detected as soon as the page loads, without waiting for subsequent operations, thus improving detection efficiency. Moreover, identifying field instances that meet the consistency rules ensures that the data used for subsequent dynamic checks is correct, laying the foundation for subsequent processing.

[0106] In this embodiment of the invention, the field model further includes field refresh behavior and field information calculation rules. Step 104 involves determining the field instance related to the preset action among the field instances that satisfy the consistency rules, and responding with the expected field information after executing the preset action. This may specifically include the following sub-steps:

[0107] Sub-step S31: Refresh the event responded to by the preset field according to the field refresh behavior indication, and determine the field instance related to the preset action among the field instances that meet the consistency rules;

[0108] Sub-step S32: Based on the field information calculation rules, determine the field instances related to the preset action, and respond with the expected field information after executing the preset action.

[0109] The field model also includes the field refresh behavior and field information calculation rules corresponding to the preset fields. The field refresh behavior refers to the triggering conditions and update mechanism when the field changes on the target page. Modeling the field refresh behavior can support dynamic consistency verification, so that we can know when the field will be updated and compare data at the correct time. It can simulate user behavior flow. In automated testing, we need to know which fields will be refreshed after which actions, so as to optimize the crawling strategy and avoid extracting invalid values ​​before the field is refreshed. For example, the field refresh behavior of the current price field can be to update it immediately when the page loads or the discount rate changes.

[0110] Field information calculation rules refer to rules that do not directly derive field values ​​from the original text, but are calculated through other fields or logical expressions. Modeling field calculation rules can automatically deduce field values, such as price = original price × discount rate. This can support large model reasoning assistance, provide clear relationships between fields, and assist large language models in semantic understanding. For example, the field information calculation rule for the current price field can be that the current price field is obtained by multiplying the original price and the discount rate.

[0111] Based on the field refresh behavior corresponding to the preset fields in the field model, determine the fields that will be refreshed due to the preset action. After determining the fields, among the field instances that satisfy the consistency rule, determine the field instances related to the preset action. The fields in the field instances related to the preset action are the fields that will be refreshed due to the preset action.

[0112] After identifying the field instance related to the preset action, the calculation rules for the field information corresponding to the field in the field instance related to the preset action are determined according to the field information calculation rules corresponding to the field in the field model. Based on the field information calculation rules corresponding to the field in the field instance related to the preset action, the expected field information corresponding to the field is determined.

[0113] By identifying the expected field information corresponding to the fields related to preset actions, and clarifying which fields should change after each action is triggered, as well as the field information after the change, it is possible to automatically predict and verify which fields will change, how they will change, and whether they meet expectations after user operations or system behaviors occur, thereby improving the efficiency of consistency verification.

[0114] In this embodiment of the invention, sub-step S11 may specifically include the following sub-steps:

[0115] Sub-step S111: Extract the third text and the feature value corresponding to the third text from the target page;

[0116] Sub-step S112: Obtain the design prototype document; based on the third text, feature values, and design prototype document, determine the preset fields corresponding to the third text, and construct the field model corresponding to the preset fields.

[0117] Extracting third-party text and its corresponding feature values ​​from a target page can be achieved using OCR technology. This allows for the acquisition of all text information on the target page, including static text and dynamically displayed fields. UI component analysis tools (such as Vision-UI) can be used to extract elements, and computer vision technology can be used to locate UI elements such as buttons, input boxes, labels, and images. This allows for the identification of page structures, including titles, input boxes, buttons, and price tags. It also supports the recognition of non-text elements (such as icons, progress bars, and switches). The third-party text and UI analysis results are then cleaned, merged, and categorized to extract meaningful "field candidates." This process transforms the raw recognition results into structured intermediate data. Finally, a prompting engineering approach combined with a large language model is used. The input includes the third-party text, its corresponding feature values, and the structured intermediate data. The large language model then understands the page's semantics and outputs structured field instances with field names and values.

[0118] Based on the field names in the structured field instances output by the large language model, determine the preset fields corresponding to the third text. The field names in the structured field instances output by the large language model can be used as the preset fields for the third text. Obtain the design prototype document corresponding to the target page, and construct the field model corresponding to the preset fields based on the data logic contained in the design prototype document and the third text.

[0119] In the process of extracting key information from a page using OCR, UI analysis, and large model reasoning, a field model is built to support consistency verification. Based on the field model, it can automatically check whether the expected fields exist on the actual page and whether the values ​​of these fields conform to the expected rules (such as calculation formulas, logical constraints, etc.). When a discrepancy is found between the fields on the page and the model (such as the absence of an important field or field values ​​not conforming to expectations), a warning can be issued in a timely manner or further manual review can be triggered, thus improving automation capabilities.

[0120] In this embodiment of the invention, step 101, extracting the first text from the target page, may specifically include the following sub-steps:

[0121] Sub-step S41: Identify the target region from the target page.

[0122] Sub-step S42: Extract the first text from the target area.

[0123] The target region refers to a key area in the UI interface that has business significance, such as product cards or price areas. Computer vision technology can be used to analyze the layout of images, identify semantic regions, segment, detect, and classify images, and identify different types of UI regions. Target region identification can also be based on the UI hierarchy structure. The primary text can be extracted from the target region using OCR technology.

[0124] Identifying target regions can divide the entire page into multiple semantic regions and extract the first text in the target region. It allows you to focus only on key areas that are relevant to the business, improving information extraction efficiency. It can also clearly identify which regions need to verify consistency and which are dynamically changing parts. Furthermore, by combining with field models, it can track whether a field in a certain region is refreshed as expected.

[0125] In this embodiment of the invention, step 106, determining the field instance corresponding to the second text, may specifically include the following sub-steps:

[0126] Determine the name of the target field in the second text that matches the field matching rule;

[0127] Based on the field information extraction rules, extract the field information corresponding to the target field name in the second text.

[0128] Determining the field instance corresponding to the second text can be done in the same way as determining the field instance corresponding to the first text: match the second text with the field model, determine the target field name corresponding to the second text, and determine the field information corresponding to the target field name based on the field model.

[0129] The method also includes:

[0130] If there is no target field name in the second text that matches the field matching rule, then determine the prototype design document of the page corresponding to the second text, determine the field name and the corresponding field model information of the second text based on the prototype design document, and add the field model information to the field model.

[0131] The second text is matched with the field matching rules corresponding to each preset field in the field model. If the second text does not match a preset field in the field model, the field model needs to be improved. First, the field corresponding to the second text that does not match the field model is determined. Then, the field model information corresponding to the field is determined by combining the design prototype document of the page corresponding to the second text. The field and the corresponding field model information are then added to the field model.

[0132] Introducing human intervention into consistency verification to confirm or correct the output results of automated consistency verification achieves human-in-the-loop automation. Through continuous human feedback, the field model is continuously corrected, gradually improving the accuracy of field recognition. When a new field appears, it can be added to the field model library after manual confirmation, supporting rapid business iteration and ensuring that the field model does not lag behind actual needs.

[0133] In this embodiment of the invention, the action chain can be automatically executed through an automation platform. First, the field model, action chain, expected field results, and other configurations are loaded into the automation platform. Then, the corresponding business changes are triggered. Next, the action chain is checked, and the corresponding results are output. The system manually reviews whether there is any data that is not marked in the current field model. If so, the data is abstracted into the corresponding field model information, and the field and the corresponding field model information are added to the field model and the automation platform, thereby achieving overall human-in-the-loop automation.

[0134] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0135] Reference Figure 2 The diagram shows a structural block diagram of a page detection device according to an embodiment of the present invention, which may specifically include the following modules:

[0136] The first text determination module 201 is used to obtain the target page and extract the first text from the target page.

[0137] The first field instance determination module 202 is used to determine the field instance corresponding to the first text. The field instance includes the field name and field information.

[0138] The first consistency determination module 203 is used to determine field instances that satisfy the consistency rules.

[0139] The expected field information determination module 204 is used to determine the field instance related to the preset action among the field instances that meet the consistency rules, and respond with the expected field information after the preset action is executed.

[0140] Action chain construction module 205 is used to construct action chains, which include preset actions.

[0141] The second consistency verification module 206 is used to determine the target page corresponding to the action chain after the action chain is executed; extract the second text from the target page corresponding to the action chain and determine the field instance corresponding to the second text; and perform consistency verification based on the field instance corresponding to the second text and the corresponding expected field information.

[0142] An embodiment of the present invention provides a page detection device that acquires a target page and extracts first text from the target page; determines a field instance corresponding to the first text, the field instance including a field name and field information; determines field instances that satisfy consistency rules; among the field instances that satisfy the consistency rules, determines a field instance related to a preset action and responds with expected field information after executing the preset action; constructs an action chain, the action chain including a preset action; after executing the action chain, determines the target page corresponding to the action chain; extracts second text from the target page corresponding to the action chain and determines a field instance corresponding to the second text; and performs consistency verification based on the field instance corresponding to the second text and the corresponding expected field information. This invention first performs a consistency check on the field instances corresponding to the first text, i.e., a static consistency check. Then, after executing the action chain, it extracts the second text from the target page corresponding to the action chain and performs a consistency check on the field instances corresponding to the second text, i.e., a dynamic consistency check. This detection method, which performs a static consistency check on the target page and a dynamic consistency check on the target page by executing the action chain, improves the accuracy of page consistency checks. Moreover, by automating the execution of the action chain, it simulates the user's actual operation path, enabling consistency checks across pages, improving testing efficiency, and avoiding the problem of a surge in the number of test cases caused by exhaustive coverage of all possible data combination states.

[0143] In this embodiment of the invention, the first field instance determination module includes:

[0144] The field model construction submodule is used to construct field models, which include preset field names, field matching rules corresponding to the preset field names, and field information extraction rules.

[0145] The first target field name determination submodule is used to determine the target field name in the first text that matches the field matching rule.

[0146] The first field information determination submodule is used to extract the field information corresponding to the target field name in the first text according to the field information extraction rules.

[0147] In this embodiment of the invention, the field model further includes field consistency rules, and a first consistency determination module, comprising:

[0148] The calculation logic consistency determination submodule is used to determine whether the field value of numeric field information is consistent with the calculation logic indicated by the field consistency rules.

[0149] The semantic consistency determination submodule is used to determine whether the text semantics of text-type field information are consistent with the semantics indicated by the field consistency rules.

[0150] In this embodiment of the invention, the field model further includes field refresh behavior and field information calculation rules, and an expected field information determination module, including:

[0151] The related field instance determination submodule is used to refresh the event responded to by the preset field according to the field refresh behavior indication. Among the field instances that meet the consistency rules, the field instance related to the preset action is determined.

[0152] The expected field information determination submodule is used to determine the field instances related to the preset action based on the field information calculation rules, and to respond with the expected field information after the preset action is executed.

[0153] In this embodiment of the invention, the field model construction submodule includes:

[0154] The third text extraction unit is used to extract the third text and the feature value corresponding to the third text from the target page;

[0155] The field model building unit is used to obtain the design prototype document, determine the preset fields corresponding to the third text based on the third text, feature values ​​and the design prototype document, and build the field model corresponding to the preset fields.

[0156] In this embodiment of the invention, the first text determination module includes:

[0157] The target region identification submodule is used to identify target regions from the target page;

[0158] The first text extraction submodule is used to extract the first text from the target area.

[0159] In this embodiment of the invention, the second consistency verification module includes:

[0160] The second target field name submodule is used to determine the target field name in the second text that matches the field matching rule;

[0161] The second field information extraction submodule is used to extract the field information corresponding to the target field name in the second text according to the field information extraction rules;

[0162] The device also includes:

[0163] The field model update module is used to determine the prototype design document of the page corresponding to the second text if there is no target field name in the second text that matches the field matching rule. Based on the prototype design document, the module determines the field name and the corresponding field model information of the second text and adds the field model information to the field model.

[0164] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0165] This invention also provides an electronic device, comprising:

[0166] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described page detection method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0167] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described page detection method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0168] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0169] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0170] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0173] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0174] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0175] The present invention has provided a detailed description of a page detection method, apparatus, electronic device, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting a page, characterized in that, The method includes: Obtain the target page and extract the first text from the target page; Determine the field instance corresponding to the first text, wherein the field instance includes the field name and field information; Identify the field instances that satisfy the consistency rules; Among the field instances that satisfy the consistency rules, determine the field instances related to the preset action, and respond with the expected field information after executing the preset action; Construct an action chain, the action chain including the preset action; After executing the action chain, the target page corresponding to the action chain is determined; the second text is extracted from the target page corresponding to the action chain, and the field instance corresponding to the second text is determined; a consistency check is performed based on the field instance corresponding to the second text and the corresponding expected field information.

2. The page detection method according to claim 1, characterized in that, Determining the field instance corresponding to the first text includes: Construct a field model, which includes a preset field name, a field matching rule corresponding to the preset field name, and a field information extraction rule; Determine the target field name in the first text that matches the field matching rule; According to the field information extraction rules, extract the field information corresponding to the target field name in the first text.

3. The page detection method according to claim 2, characterized in that, The field model also includes field consistency rules, and determining the field instances that satisfy the consistency rules includes: For numerical field information, determine whether the field value of the field information is consistent with the calculation logic indicated by the field consistency rule; For text-based field information, determine whether the textual semantics of the field information are consistent with the semantics indicated by the field consistency rule.

4. The page detection method according to claim 3, characterized in that, The field model also includes field refresh behavior and field information calculation rules. The step of determining the field instance related to the preset action among the field instances that satisfy the consistency rules, and responding with the expected field information after executing the preset action, includes: According to the event that responds to refreshing the preset field indicated by the field refresh behavior, among the field instances that satisfy the consistency rule, determine the field instance related to the preset action; Based on the field information calculation rules, determine the field instance related to the preset action, and respond with the expected field information after executing the preset action.

5. The page detection method according to claim 3, characterized in that, The construction of the field model includes: Extract the third text and the corresponding feature values ​​from the target page; Obtain the design prototype document, determine the preset fields corresponding to the third text based on the third text, the feature values, and the design prototype document, and construct the field model corresponding to the preset fields.

6. The page detection method according to claim 1, characterized in that, The step of extracting the first text from the target page includes: Identify the target region from the target page; Extract the first text from the target area.

7. The page detection method according to claim 2, characterized in that, Determining the field instance corresponding to the second text includes: Determine the target field name in the second text that matches the field matching rule; According to the field information extraction rules, extract the field information corresponding to the target field name in the second text; The method further includes: If there is no target field name in the second text that matches the field matching rule, then the prototype design document of the page corresponding to the second text is determined, the field name corresponding to the second text and the corresponding field model information are determined according to the prototype design document, and the field model information is added to the field model.

8. A page detection device, characterized in that, The device includes: The first text determination module is used to obtain a target page and extract first text from the target page; The first field instance determination module is used to determine the field instance corresponding to the first text, wherein the field instance includes a field name and field information; The first consistency determination module is used to determine the field instances that satisfy the consistency rules; The expected field information determination module is used to determine the field instance related to the preset action among the field instances that satisfy the consistency rule, and respond with the expected field information after the preset action is executed; An action chain construction module is used to construct an action chain, wherein the action chain includes the preset action; The second consistency verification module is used to determine the target page corresponding to the action chain after the action chain is executed; extract the second text from the target page corresponding to the action chain and determine the field instance corresponding to the second text; and perform consistency verification based on the field instance corresponding to the second text and the corresponding expected field information.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the page detection method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the page detection method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Numerical calculation proofreading method and system, storage medium and electronic equipment

    CN121117195A