Web control element management method, device, electronic device and medium

By receiving Web system information, using page crawlers and menu traversal algorithms to identify and mark Web controls, parsing HTML source code to obtain the location path and verify it, the problem of low efficiency in Web control element management is solved and efficient and intelligent management is achieved.

CN116431950BActive Publication Date: 2025-09-16PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310413121.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2025-09-16
Estimated Expiration
2043-04-10

AI Technical Summary

Technical Problem

The existing technology has low efficiency and insufficient intelligence in managing Web control elements. When refactoring a project, control elements need to be retrieved again, which increases manual effort and makes management difficult.

Method used

By receiving basic information of the Web system, using the page crawler mechanism to obtain account information, combining the menu traversal algorithm and image recognition algorithm to identify and uniquely mark controls, parsing the HTML source code to obtain the control location path, and performing verification and storage, it reduces manual operations and improves the level of intelligence.

Benefits of technology

It improves the efficiency and intelligence of Web control element management, reduces labor costs, ensures the accuracy and uniqueness of control positioning paths, and simplifies management difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116431950B_ABST
    Figure CN116431950B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence and discloses a method, device, electronic device, and storage medium for managing Web control elements. The method comprises: receiving account information of a Web system; clicking menus in the Web system one by one based on the account information to obtain a menu page set; identifying the Web control on each menu page in the menu page set and marking the Web control with a unique Web control number; obtaining the HTML source code of the menu page set and parsing the HTML source code based on the unique Web control number to obtain a control location path; verifying the control location path, editing the Web control corresponding to the control location path that failed verification, performing a secondary verification on the edited Web control to obtain a verification result; and, if the verification result is successful, storing the Web control and the control location path in a preset database. The present invention can improve the management efficiency and intelligent management of Web control elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a Web control element management method, device, electronic device, and readable storage medium. Background Art

[0002] Web controls encapsulate data and methods in the global wide area network. Currently, the most common method for managing Web control elements is to manually locate them using the browser's built-in element location tool. The user then uses a script to verify the validity of the location. This process lacks intelligence, resulting in inefficient locating of Web control elements and making Web control element management difficult. Furthermore, when a project is refactored, previously acquired Web control elements must be discarded and reacquired, further increasing manual effort and reducing Web control element management efficiency. Summary of the Invention

[0003] The present invention provides a Web control element management method, device, electronic device and readable storage medium, which aims to improve the management efficiency and intelligent management level of Web control elements.

[0004] To achieve the above object, the present invention provides a method for managing Web control elements, the method comprising:

[0005] Receive basic information of the Web system and use a preset page crawler mechanism to read the account information in the basic information;

[0006] According to the account information, using a menu traversal algorithm, click on the menus in the Web system one by one to obtain a menu page set;

[0007] Identify the web control of each menu page in the menu page set according to an image recognition algorithm, and uniquely mark the web control to obtain a unique number for the web control;

[0008] Obtaining the HTML source code of each menu page in the menu page set, and parsing the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control;

[0009] Verifying the control location path, editing the Web control corresponding to the control location path that fails verification, and performing a second verification on the edited Web control to obtain a verification result;

[0010] When the verification result is failure, returning to the step of verifying the control location path, editing the Web control corresponding to the control location path that failed the verification, performing a second verification on the edited Web control, and obtaining a verification result, until all the verification results are successful;

[0011] When the verification result is successful, the Web control and the control location path are stored in a preset database.

[0012] Optionally, the menu traversal algorithm is used to click on each menu in the Web system one by one according to the account information to obtain a menu page set, including:

[0013] According to the account information, the preset Webdriver library is called to log in to the Web system and obtain the target Web system after the login account;

[0014] Using the click interface in the webdriver library to search for menu pages of all target web systems, and obtain an initial menu page set;

[0015] Traversing the first-level menus in the initial menu page set to obtain a first-level menu page set;

[0016] Obtaining the first-level menu ID of the first-level menu in the first-level menu page set, traversing the initial menu page set based on the first-level menu ID to obtain a second-level menu page set, and continuing to traverse the initial menu page set based on the second-level menu ID of the second-level menu in the second-level menu page set until no corresponding menu page is found, thereby obtaining a multi-level menu page set;

[0017] The first-level menu page set, the second-level menu page set and the multi-level menu page set are hierarchically integrated to obtain a menu page set.

[0018] Optionally, parsing the HTML source code according to the unique number of the Web control to obtain a control location path corresponding to the Web control includes:

[0019] Parsing the HTML source code to obtain the HTML source code body;

[0020] Searching the HTML source code body for a Web control source code with a control element tag;

[0021] According to the unique number of the Web control, the source code of the Web control is searched to obtain the control location path corresponding to each Web control.

[0022] Optionally, identifying the web control of each menu page in the menu page set according to an image recognition algorithm includes:

[0023] Extracting a global feature vector of each icon in each menu page;

[0024] Calculating the global similarity between the global feature vector and the global feature vector of a preset Web control template image;

[0025] Extracting local feature vectors of icons whose global similarity is higher than a first preset threshold;

[0026] The local similarity between the local feature vector and the local feature vector of the preset Web control template image is calculated, and the menu page elements corresponding to the icons with the local similarity higher than a second preset threshold are used as Web controls.

[0027] Optionally, the uniquely marking the Web control to obtain a unique number for the Web control includes:

[0028] Finding the menu page where the web control is located in the menu page set position in the menu page set, and generating a web control major number according to the menu page set position;

[0029] Finding a menu page position of the Web control in the menu page where the Web control is located, and generating a Web control sub-number according to the menu page position;

[0030] The Web control unique number is obtained by combining the Web control major number and the Web control minor number.

[0031] Optionally, the verifying the control location path includes:

[0032] Using a preset element positioning mechanism to traverse the Web control data in the HTML source code to obtain detailed information of each Web control;

[0033] Generate an absolute path for each of the Web controls using XPath language according to the detailed information;

[0034] Determine whether the absolute path is consistent with the control located by the control location path;

[0035] When the absolute path is consistent with the control located by the control location path, it is determined that the control location path verification is successful;

[0036] When the absolute path is inconsistent with the control located by the control location path, it is determined that the control location path verification fails.

[0037] Optionally, the using a preset page crawler mechanism to read the account information in the basic information includes:

[0038] Obtain the IP address of the storage server corresponding to the basic information using a preset programming language;

[0039] Filtering target index addresses related to the basic information from the storage server corresponding to the basic information using a web page analysis algorithm, and storing the target index addresses in a queue to be captured;

[0040] According to a preset search strategy, the target index address is captured from the to-be-captured queue until the target index address meets a preset quota, and then the target index address is stopped;

[0041] The basic information corresponding to the target index address is analyzed, and filtering is performed according to the analysis result to obtain the account information.

[0042] In order to solve the above problems, the present invention further provides a Web control element management device, the device comprising:

[0043] A menu acquisition module is used to receive basic information of the Web system, read the account information in the basic information using a preset page crawler mechanism, and click on the menus in the Web system one by one based on the account information using a menu traversal algorithm to obtain a set of menu pages;

[0044] a location path acquisition module, configured to identify the Web control of each menu page in the menu page set based on an image recognition algorithm, uniquely mark the Web control to obtain a unique Web control number, obtain the HTML source code of each menu page in the menu page set, and parse the HTML source code based on the unique Web control number to obtain a control location path corresponding to the Web control;

[0045] The positioning path verification module is used to verify the control positioning path, edit the Web control corresponding to the control positioning path that fails the verification, perform a secondary verification on the edited Web control, and obtain a verification result. When the verification result is failed, return to the step of verifying the control positioning path, editing the Web control corresponding to the control positioning path that fails the verification, and performing a secondary verification on the edited Web control to obtain a verification result, until all the verification results are successful. When the verification result is successful, the Web control and the control positioning path are stored in a preset database.

[0046] In order to solve the above problem, the present invention further provides an electronic device, comprising:

[0047] a memory storing at least one computer program; and

[0048] The processor executes the computer program stored in the memory to implement the above-mentioned Web control element management method.

[0049] In order to solve the above problem, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned Web control element management method.

[0050] In an embodiment of the present invention, based on the account information and utilizing a menu traversal algorithm, menus in the Web system are clicked one by one to obtain a menu page set, thereby constructing the menu page set. This ensures the neatness of the menu pages and facilitates subsequent unique marking of Web controls. Furthermore, the Web controls are uniquely marked to obtain unique Web control numbers, ensuring that Web control numbers are not repeated, thereby reducing the probability of Web control reading errors and improving the management efficiency of Web control elements. Secondly, the HTML source code of each menu page in the menu page set is obtained, and the HTML source code is parsed based on the Web control unique number to obtain a control location path corresponding to the Web control. This reduces manual intervention and thus labor costs, speeds up the location of Web control elements, and improves the intelligent management and management efficiency of Web control elements. Finally, the control location path is verified, and the Web controls corresponding to the control location paths that fail verification are verified again until all control location path verifications are successful. This ensures the accuracy of the control location path corresponding to the Web control element, thereby achieving management of each Web control element and improving the accuracy of Web control element management. Therefore, the Web control element management method, apparatus, device, and storage medium provided by the present invention can improve the management efficiency and intelligent management level of Web control elements. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of a method for managing Web control elements provided by one embodiment of the present invention;

[0052] Figures 2 to 3 A detailed implementation flowchart of one step in a Web control element management method provided by one embodiment of the present invention;

[0053] Figure 4 A schematic diagram of modules of a Web control element management device provided by an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of the internal structure of an electronic device for implementing a method for managing Web control elements provided by an embodiment of the present invention;

[0055] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0057] An embodiment of the present invention provides a method for managing Web control elements. The execution subject of the Web control element management method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the Web control element management method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server can include an independent server, or it can include a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0058] Reference Figure 1 FIG. 1 is a flow chart of a method for managing Web control elements according to an embodiment of the present invention. In the embodiment of the present invention, the method for managing Web control elements includes:

[0059] S1. Receive basic information of a Web system and use a preset page crawler mechanism to read account information in the basic information.

[0060] In an embodiment of the present invention, the web system may be a global, dynamically interactive, cross-platform distributed graphical information system based on hypertext and HTTP. The basic information includes information such as the web system URL, account number, and password. The URL may be a representation method for specifying an information location on the web system. The crawler mechanism may be a mechanism that utilizes the high speed of computers to efficiently acquire data in batches through a written program. The account number information may include the account number and corresponding password information in the basic information.

[0061] In an optional embodiment of the present invention, when the front-end control panel of the Web system receives the basic information of the Web system, the basic information is sent to the server of the Web system through the front-end data exchange module, thereby receiving the basic information of the Web system.

[0062] The embodiment of the present invention utilizes a preset page crawler mechanism to read the account information in the basic information, ensuring that the backend of the Web system can log in to the specified system, thereby realizing the management of the Web system control elements, reducing manual operations, and improving the intelligence level of the management of the Web system control elements.

[0063] Further, as an optional embodiment of the present invention, refer to Figure 2 As shown, the method of using a preset page crawler mechanism to read the account information in the basic information in S1 includes:

[0064] S11. Obtain the IP address of the storage server corresponding to the basic information using a preset programming language;

[0065] S12, using a web page analysis algorithm to filter out target index addresses related to the basic information from the storage server corresponding to the basic information, and storing the target index addresses in a queue to be captured;

[0066] S13, crawling the target index address from the to-be-crawled queue according to a preset search strategy, until the target index address meets a preset limit, then stopping crawling the target index address;

[0067] S14: Analyze the basic information corresponding to the target index address, and filter according to the analysis result to obtain account information.

[0068] In an embodiment of the present invention, the programming language may be a programming language such as Python or C. The basic information storage server may be a server on the web system server side that stores basic information. The target index address may be an index address of a database storing the basic information. The web page analysis algorithm may be an algorithm such as PageRank or HITS. The preset search strategy may be crawling based on whether the target index address contains the required information.

[0069] In an optional embodiment of the present invention, crawler instructions are written in Python programming language, and account information is crawled from the basic information storage server according to the crawler instructions, thereby reducing the time of manual information screening, improving the speed of account information collection, and thus accelerating the efficiency of locating Web control elements.

[0070] S2. According to the account information, a menu traversal algorithm is used to click on the menus in the Web system one by one to obtain a menu page set.

[0071] In the embodiment of the present invention, the menu traversal algorithm may be a recursive traversal algorithm.

[0072] The embodiment of the present invention utilizes a menu traversal algorithm based on the account information to click on the menus in the Web system one by one to obtain a menu page set, thereby realizing the collection of the Web system menus, thereby facilitating the centralized management of the control elements in the Web system menus and simplifying the management of Web control elements.

[0073] Further, as an optional embodiment of the present invention, refer to Figure 3 As shown, the S2 includes:

[0074] S21. Based on the account information, call the preset Webdriver library to log in to the Web system and obtain the target Web system after logging in to the account;

[0075] S22, using the click interface in the webdriver library to search for menu pages of all target web systems to obtain an initial menu page set;

[0076] S23, traversing the first-level menus in the initial menu page set to obtain a first-level menu page set;

[0077] S24. Obtain the first-level menu ID of the first-level menu in the first-level menu page set, traverse the initial menu page set based on the first-level menu ID to obtain a second-level menu page set, and continue traversing the initial menu page set based on the second-level menu ID of the second-level menu in the second-level menu page set until no corresponding menu page is found, thereby obtaining a multi-level menu page set;

[0078] S25 , hierarchically integrating the first-level menu page set, the second-level menu page set, and the multi-level menu page set to obtain a menu page set.

[0079] In an embodiment of the present invention, the webdriver library may be an automatic testing tool based on a Web system application. The first-level menu may be a menu directly displayed on the Web system page. The second-level menu may be a menu directly displayed on the first-level menu page.

[0080] In an optional embodiment of the present invention, since the menu ID of the previous menu page is the same as the parent ID of the next menu page, the corresponding next menu can be obtained by querying the menu page in the initial menu page set whose parent ID is the menu ID of the previous menu page.

[0081] In the embodiment of the present invention, the menu pages of the Web system are hierarchically graded using a layer-by-layer progressive method, thereby realizing the construction of a menu page set, ensuring the neatness of the menu pages, and facilitating the unique marking of subsequent Web controls.

[0082] S3. Identify the Web control of each menu page in the menu page set according to an image recognition algorithm, and uniquely mark the Web control to obtain a unique number for the Web control.

[0083] In an embodiment of the present invention, the image recognition algorithm may be a recognition algorithm based on deep learning, which is commonly used in image recognition. The web control may be an encapsulation of data and methods in a web system, and is generally displayed in each level of menu page in the form of a fixed image.

[0084] The embodiment of the present invention identifies the Web control of each menu page in the menu page set based on an image recognition algorithm, thereby acquiring the control elements in the Web system, reducing manual input, improving the intelligence level of acquiring the control elements in the Web system, and improving the management efficiency of the Web control elements.

[0085] Furthermore, as an optional embodiment of the present invention, the step of identifying the web control of each menu page in the menu page set according to the image recognition algorithm in S3 includes:

[0086] Extracting a global feature vector of each icon in each menu page;

[0087] Calculating the global similarity between the global feature vector and the global feature vector of a preset Web control template image;

[0088] Extracting local feature vectors of icons whose global similarity is higher than a first preset threshold;

[0089] The local similarity between the local feature vector and the local feature vector of the preset Web control template image is calculated, and the menu page elements corresponding to the icons with the local similarity higher than a second preset threshold are used as Web controls.

[0090] In the embodiment of the present invention, the global feature vector includes color features, texture features and shape features, such as intensity histogram. The local feature vector can be a local expression of the image features of the icon on the menu page, reflecting the local characteristics of the image.

[0091] In an optional embodiment of the present invention, since the global feature vector only includes color features, texture features and shape features, after extracting the global features of the icon in the menu page, only a relatively vague icon feature can be obtained, and it cannot be determined that the icon is definitely a Web control icon. Therefore, it is necessary to further extract the local features of the icon that has passed the similarity screening and perform similarity calculation to determine whether the icon is a Web control icon.

[0092] In an optional embodiment of the present invention, a two-dimensional discrete Fourier transform formula can be used to extract the global feature vector of each icon in each menu page, and a two-dimensional Gabor wavelet kernel function can be used to extract local feature vectors of icons whose global similarity is higher than a preset threshold, so as to ensure the accuracy of the global feature vector and thereby improve the accuracy of Web control element positioning.

[0093] In another optional embodiment of the present invention, a normalized cross-correlation algorithm can be used to calculate the global similarity between the global feature vector and the global feature vector of the preset Web control template image, and a similarity algorithm can be used to calculate the local similarity between the local feature vector and the local feature vector of the preset Web control template image, thereby improving the accuracy of Web control element positioning.

[0094] Furthermore, the embodiment of the present invention uniquely marks the Web control to obtain a unique number for the Web control, thereby ensuring neatness and orderliness in the management of Web system control elements, simplifying the difficulty of Web system control element management, and improving the efficiency of Web system control element management.

[0095] Specifically, the step of uniquely marking the Web control in S3 to obtain a unique number for the Web control includes:

[0096] Finding the menu page where the web control is located in the menu page set position in the menu page set, and generating a web control major number according to the menu page set position;

[0097] Finding a menu page position of the Web control in the menu page where the Web control is located, and generating a Web control sub-number according to the menu page position;

[0098] The Web control unique number is obtained by combining the Web control major number and the Web control minor number.

[0099] In an optional embodiment of the present invention, the Web controls are numbered according to the position of the menu page where the Web control is located in the menu page set and the position of the Web control on the menu page, thereby obtaining a unique number for the Web control, ensuring that each Web control has unique characteristics, facilitating the subsequent generation of a Web control location path, and ensuring the uniqueness of the path.

[0100] S4. Obtain the HTML source code of each menu page in the menu page set, and parse the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control.

[0101] In an embodiment of the present invention, the HTML source code may be a combination of HTML syntaxes to display images and text in a browser. The HTML may be a language that adds markers to certain words and sentences to achieve a desired effect. The control location path may be a language that determines the location of the control element.

[0102] In an optional embodiment of the present invention, the HTML source code of each menu page in the menu page set is crawled by a page crawler, thereby obtaining the HTML source code of the menu page, reducing manual input and accelerating the positioning speed of the Web control element.

[0103] The embodiment of the present invention parses the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control, thereby reducing the steps of manually clicking to obtain the location of the Web control element, improving the intelligence level of Web control element positioning and the efficiency of obtaining the location of the Web control element, thereby reducing the difficulty of Web control element management.

[0104] Furthermore, as an optional embodiment of the present invention, the step of parsing the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control in S4 includes:

[0105] Parsing the HTML source code to obtain the HTML source code body;

[0106] Searching the HTML source code body for a Web control source code with a control element tag;

[0107] According to the unique number of the Web control, the source code of the Web control is searched to obtain the control location path corresponding to each Web control.

[0108] In the embodiment of the present invention, the control element tags include tags such as <input>, <textarea> / textarea>, and <select> / select>. For example, in <input type="text">, type is a property of the control, and "text" is a unique number of the control element.

[0109] In an optional embodiment of the present invention, since each Web control has a unique number, that is, a unique characteristic, when obtaining the control location path corresponding to the Web control, a relative path in the XPath language can be used to represent the control location path corresponding to each Web control, thereby simplifying the location path length of the Web control and improving the location efficiency of the Web control element.

[0110] S5. Verify the control location path, edit the Web control corresponding to the control location path that fails verification, and perform a second verification on the edited Web control to obtain a verification result.

[0111] The embodiment of the present invention verifies the control location path to ensure that the detailed information of the Web control is accurate, thereby achieving management of each Web control element and improving the accuracy of Web control element management.

[0112] Furthermore, as an optional embodiment of the present invention, the verifying of the control location path in S5 includes:

[0113] Using a preset element positioning mechanism to traverse the Web control data in the HTML source code to obtain detailed information of each Web control;

[0114] Generate an absolute path for each of the Web controls using XPath language according to the detailed information;

[0115] Determine whether the absolute path is consistent with the control located by the control location path;

[0116] When the absolute path is consistent with the control located by the control location path, it is determined that the control location path verification is successful;

[0117] When the absolute path is inconsistent with the control located by the control location path, it is determined that the control location path verification fails.

[0118] In embodiments of the present invention, the XPath language can be used to determine the location of a portion within an XML document. HTML source code is generally in XML document format and can therefore be described using the XPath language. An absolute path refers to a specific location using an absolute, fixed starting point as a reference. For example, when locating a Web control element, a fixed starting point within the HTML file is typically used as a reference.

[0119] In an optional embodiment of the present invention, since the absolute path and the control location path are expressed differently, positioning failure may occur during the Web control element positioning process. Therefore, it is necessary to verify the control location path to ensure that the control location path of each control is accurate, thereby improving the accuracy of Web control element management.

[0120] In an optional embodiment of the present invention, when the control location path verification fails, the editing operation of the Web control can be implemented by editing the corresponding front-end Web control, and the edited Web control can be verified by clicking the verification operation. Furthermore, when the server receives the verification request, it will verify the latest incoming front-end Web control data to obtain the corresponding Web control verification result.

[0121] S6. Determine whether the verification result is successful.

[0122] In an optional embodiment of the present invention, since editing the Web control corresponding to the control location path that failed verification does not necessarily ensure that the Web control data is accurate during the secondary verification, it is necessary to sort out and integrate the verification results of the secondary verification to ensure that the control data of each control is accurate.

[0123] When the verification result is failure, S7 returns to the step corresponding to S5 until all the verification results are success.

[0124] In an optional embodiment of the present invention, when the verification result is failed, that is, there are still Web controls whose control location paths fail verification, therefore, it is necessary to edit the Web controls corresponding to the control location paths that fail verification again until all the verification results are successful, ensuring that the detailed information of the Web controls is accurate, thereby realizing the management of each Web control element and improving the accuracy of Web control element management.

[0125] When the verification result is successful, S8, the Web control and the control location path are stored in a preset database.

[0126] In an optional embodiment of the present invention, when the verification result is successful, that is, when the control location path verification of each Web control is successful, in order to facilitate the management of the control location path corresponding to the accurate Web control data set, the Web control and the control location path can be stored in a preset database, which facilitates the implementation of Web control element management and simplifies the difficulty of Web control element management.

[0127] In an embodiment of the present invention, based on the account information and utilizing a menu traversal algorithm, menus in the Web system are clicked one by one to obtain a menu page set, thereby constructing the menu page set. This ensures the neatness of the menu pages and facilitates subsequent unique marking of Web controls. Furthermore, the Web controls are uniquely marked to obtain unique Web control numbers, ensuring that Web control numbers are not repeated, thereby reducing the probability of Web control reading errors and improving the management efficiency of Web control elements. Secondly, the HTML source code of each menu page in the menu page set is obtained, and the HTML source code is parsed based on the Web control unique number to obtain a control location path corresponding to the Web control. This reduces manual intervention and thus labor costs, speeds up the location of Web control elements, and improves the intelligent management and management efficiency of Web control elements. Finally, the control location path is verified, and the Web controls corresponding to the control location paths that fail verification are verified again until all control location path verifications are successful. This ensures the accuracy of the control location path corresponding to the Web control element, thereby achieving management of each Web control element and improving the accuracy of Web control element management. Therefore, the Web control element management method provided by the present invention can improve the management efficiency and intelligent management level of Web control elements.

[0128] like Figure 4 FIG. 1 is a functional module diagram of the Web control element management device of the present invention.

[0129] The web control element management device 100 of the present invention can be installed in an electronic device. Depending on the functionality implemented, the web control element management device 100 may include a menu acquisition module 101, a location path acquisition module 102, and a location path verification module 103. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.

[0130] In this embodiment, the functions of each module / unit are as follows:

[0131] The menu acquisition module 101 is used to receive basic information of the Web system, read the account information in the basic information using a preset page crawler mechanism, and click on the menus in the Web system one by one based on the account information using a menu traversal algorithm to obtain a menu page set.

[0132] The location path acquisition module 102 is used to identify the Web control of each menu page in the menu page set based on an image recognition algorithm, uniquely mark the Web control, obtain a unique number for the Web control, obtain the HTML source code of each menu page in the menu page set, and parse the HTML source code based on the unique number of the Web control to obtain a control location path corresponding to the Web control.

[0133] The location path verification module 103 is used to verify the control location path, edit the Web control corresponding to the control location path that failed the verification, perform a secondary verification on the edited Web control, and obtain a verification result. When the verification result is failed, return to the step of verifying the control location path, editing the Web control corresponding to the control location path that failed the verification, and performing a secondary verification on the edited Web control to obtain a verification result, until all the verification results are successful. When the verification result is successful, the Web control and the control location path are stored in a preset database.

[0134] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a Web control element management method according to the present invention.

[0135] The electronic device may include a processor 10 , a memory 11 , a communication bus 12 , and a communication interface 13 , and may further include a computer program stored in the memory 11 and executable on the processor 10 , such as a Web control element management program.

[0136] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example: SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the Web control element management program, but can also be used to temporarily store data that has been output or is to be output.

[0137] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing programs or modules (such as a Web control element manager) stored in the memory 11, as well as calling data stored in the memory 11, to perform various functions of the electronic device and process data.

[0138] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Such a bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to enable communication between the memory 11 and at least one processor 10. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0139] Figure 5 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 5 The structure shown does not limit the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0140] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management device, thereby implementing functions such as charge management, discharge management, and power consumption management through the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, etc. The electronic device may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0141] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.

[0142] Optionally, the communication interface 13 may further include a user interface, which may be a display or an input unit (such as a keyboard). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0143] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0144] The web control element management program stored in the memory 11 of the electronic device is a combination of multiple computer programs. When running in the processor 10, it can achieve the following:

[0145] Receive basic information of the Web system and use a preset page crawler mechanism to read the account information in the basic information;

[0146] According to the account information, using a menu traversal algorithm, click on the menus in the Web system one by one to obtain a menu page set;

[0147] Identify the web control of each menu page in the menu page set according to an image recognition algorithm, and uniquely mark the web control to obtain a unique number for the web control;

[0148] Obtaining the HTML source code of each menu page in the menu page set, and parsing the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control;

[0149] Verifying the control location path, editing the Web control corresponding to the control location path that fails verification, and performing a second verification on the edited Web control to obtain a verification result;

[0150] When the verification result is failure, returning to the step of verifying the control location path, editing the Web control corresponding to the control location path that failed the verification, performing a second verification on the edited Web control, and obtaining a verification result, until all the verification results are successful;

[0151] When the verification result is successful, the Web control and the control location path are stored in a preset database.

[0152] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0153] Furthermore, if the module / unit integrated into the electronic device is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, or read-only memory (ROM).

[0154] An embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program may implement:

[0155] Receive basic information of the Web system and use a preset page crawler mechanism to read the account information in the basic information;

[0156] According to the account information, using a menu traversal algorithm, click on the menus in the Web system one by one to obtain a menu page set;

[0157] Identify the web control of each menu page in the menu page set according to an image recognition algorithm, and uniquely mark the web control to obtain a unique number for the web control;

[0158] Obtaining the HTML source code of each menu page in the menu page set, and parsing the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control;

[0159] Verifying the control location path, editing the Web control corresponding to the control location path that fails verification, and performing a second verification on the edited Web control to obtain a verification result;

[0160] When the verification result is failure, returning to the step of verifying the control location path, editing the Web control corresponding to the control location path that failed the verification, performing a second verification on the edited Web control, and obtaining a verification result, until all the verification results are successful;

[0161] When the verification result is successful, the Web control and the control location path are stored in a preset database.

[0162] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0163] In the several embodiments provided herein, it should be understood that the disclosed electronic devices, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods.

[0164] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0165] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.

[0166] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0167] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0168] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0169] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A Web control element management method, characterized in that: The method comprises: Receive basic information of the Web system and use a preset page crawler mechanism to read the account information in the basic information; According to the account information, using a menu traversal algorithm, click on the menus in the Web system one by one to obtain a menu page set; Identify the web control of each menu page in the menu page set according to an image recognition algorithm, and uniquely mark the web control to obtain a unique number for the web control; Obtaining the HTML source code of each menu page in the menu page set, and parsing the HTML source code according to the unique number of the Web control to obtain the control location path corresponding to the Web control; Verifying the control location path, editing the Web control corresponding to the control location path that fails verification, and performing a second verification on the edited Web control to obtain a verification result; When the verification result is failure, returning to the step of verifying the control location path, editing the Web control corresponding to the control location path that failed the verification, performing a second verification on the edited Web control, and obtaining a verification result, until all the verification results are successful; When the verification result is successful, the Web control and the control location path are stored in a preset database.

2. The Web control element management method according to claim 1, wherein: The menu traversal algorithm is used to click on each menu in the Web system according to the account information to obtain a menu page set, including: According to the account information, the preset Webdriver library is called to log in to the Web system and obtain the target Web system after the login account; Using the click interface in the Webdriver library to search for menu pages of all target Web systems, and obtain an initial menu page set; Traversing the first-level menus in the initial menu page set to obtain a first-level menu page set; Obtaining the first-level menu ID of the first-level menu in the first-level menu page set, traversing the initial menu page set based on the first-level menu ID to obtain a second-level menu page set, and continuing to traverse the initial menu page set based on the second-level menu ID of the second-level menu in the second-level menu page set until no corresponding menu page is found, thereby obtaining a multi-level menu page set; The first-level menu page set, the second-level menu page set and the multi-level menu page set are hierarchically integrated to obtain a menu page set.

3. The Web control element management method according to claim 1, wherein: The step of parsing the HTML source code according to the unique number of the Web control to obtain a control location path corresponding to the Web control includes: Parsing the HTML source code to obtain the HTML source code body; Searching the HTML source code body for a Web control source code with a control element tag; According to the unique number of the Web control, the source code of the Web control is searched to obtain the control location path corresponding to each Web control.

4. The Web control element management method according to claim 1, wherein: The identifying, according to an image recognition algorithm, a Web control of each menu page in the menu page set includes: Extracting a global feature vector of each icon in each menu page; Calculating the global similarity between the global feature vector and the global feature vector of a preset Web control template image; Extracting local feature vectors of icons whose global similarity is higher than a first preset threshold; The local similarity between the local feature vector and the local feature vector of the preset Web control template image is calculated, and the menu page elements corresponding to the icons with the local similarity higher than a second preset threshold are used as Web controls.

5. The Web control element management method according to claim 1, wherein: The uniquely marking the Web control to obtain a unique number for the Web control includes: Finding the menu page where the web control is located in the menu page set position in the menu page set, and generating a web control major number according to the menu page set position; Finding a menu page position of the Web control in the menu page where the Web control is located, and generating a Web control sub-number according to the menu page position; The Web control unique number is obtained by combining the Web control major number and the Web control minor number.

6. The Web control element management method according to claim 1, wherein: The verifying the control location path includes: Using a preset element positioning mechanism to traverse the Web control data in the HTML source code to obtain detailed information of each Web control; Generate an absolute path for each of the Web controls using XPath language according to the detailed information; Determine whether the absolute path is consistent with the control located by the control location path; When the absolute path is consistent with the control located by the control location path, it is determined that the control location path verification is successful; When the absolute path is inconsistent with the control located by the control location path, it is determined that the control location path verification fails.

7. The Web control element management method according to claim 1, wherein: The method of using a preset page crawler mechanism to read the account information in the basic information includes: Obtain the IP address of the storage server corresponding to the basic information using a preset programming language; Filtering target index addresses related to the basic information from the storage server corresponding to the basic information using a web page analysis algorithm, and storing the target index addresses in a queue to be captured; According to a preset search strategy, the target index address is captured from the to-be-captured queue until the target index address meets a preset quota, and then the target index address is stopped; The basic information corresponding to the target index address is analyzed, and filtering is performed according to the analysis result to obtain the account information.

8. A Web control element management device, characterized in that: The device comprises: A menu acquisition module is used to receive basic information of the Web system, read the account information in the basic information using a preset page crawler mechanism, and click on the menus in the Web system one by one based on the account information using a menu traversal algorithm to obtain a set of menu pages; a location path acquisition module, configured to identify the Web control of each menu page in the menu page set based on an image recognition algorithm, uniquely mark the Web control to obtain a unique Web control number, obtain the HTML source code of each menu page in the menu page set, and parse the HTML source code based on the unique Web control number to obtain a control location path corresponding to the Web control; The positioning path verification module is used to verify the control positioning path, edit the Web control corresponding to the control positioning path that fails the verification, perform a secondary verification on the edited Web control, and obtain a verification result. When the verification result is failed, return to the step of verifying the control positioning path, editing the Web control corresponding to the control positioning path that fails the verification, and performing a secondary verification on the edited Web control to obtain a verification result, until all the verification results are successful. When the verification result is successful, the Web control and the control positioning path are stored in a preset database.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor. The computer program instructions are executed by the at least one processor to enable the at least one processor to perform the Web control element management method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the Web control element management method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Page and control increasing method based on WEB

    CN103646023A

  • Application program integration method and device, storage medium and server

    CN110764775A