CN113722191B - Page monitoring method, device, equipment and computer readable storage medium - Google Patents

Page monitoring method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN113722191B
CN113722191B CN202111296738.3A CN202111296738A CN113722191B CN 113722191 B CN113722191 B CN 113722191B CN 202111296738 A CN202111296738 A CN 202111296738A CN 113722191 B CN113722191 B CN 113722191B
Authority
CN
China
Prior art keywords
information
page
standard
interface
matching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111296738.3A
Other languages
Chinese (zh)
Other versions
CN113722191A (en
Inventor
林斌
唐磊
李俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qichacha Technology Co ltd
Original Assignee
Qichacha Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qichacha Technology Co ltd filed Critical Qichacha Technology Co ltd
Priority to CN202111296738.3A priority Critical patent/CN113722191B/en
Publication of CN113722191A publication Critical patent/CN113722191A/en
Application granted granted Critical
Publication of CN113722191B publication Critical patent/CN113722191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a page monitoring method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: updating a page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information; and searching standard information corresponding to the matching information in a preset standard database, and outputting a warning trigger signal when the matching information is inconsistent with the standard information. The page monitoring method provided by the invention not only can simultaneously check the matching condition between the page information and the interface information, but also can respectively compare the page information and the interface information with the pre-stored information to form a double-layer check logic architecture, thereby ensuring that the page monitoring process is high-speed and effective, does not need manual intervention, and can sufficiently cope with the complex conditions of errors of dynamic pages and interfaces and the like.

Description

Page monitoring method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a page monitoring method, apparatus, device, and computer-readable storage medium.
Background
With the development of web pages or page technologies in the form of H5 (Hyper Text Markup Language 5, HTML5, hypertext 5.0) and the like, the data volume of H5 pages is increased sharply by embedding various programs, and although the form and functions of H5 pages are enriched and diversified, the check of important field information in H5 pages is difficult undoubtedly. In order to ensure accurate display of field information in a page, in the prior art, technical staff usually check field contents manually or write a fixed script program to monitor the activity condition of the page, but the former is time-consuming and labor-consuming, has a lag in correction and is easy to miss and error, the latter can only monitor the field information of a static page, frequently and erroneously triggers warning for a page with real-time data change, and the phase change increases the operation difficulty of the technical staff, and the data condition of a corresponding interface of the page cannot be monitored accurately, so that the technical staff cannot determine the source of error report, and a good monitoring effect cannot be achieved.
Disclosure of Invention
One of the objectives of the present invention is to provide a page monitoring method, so as to solve the technical problem in the prior art that field value information and corresponding interface information in a page cannot be monitored in real time.
One of the objectives of the present invention is to provide a page monitoring apparatus.
An object of the present invention is to provide an electronic device.
An object of the present invention is to provide a computer-readable storage medium.
To achieve one of the above objects, an embodiment of the present invention provides a page monitoring method, including: updating a page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information; and searching standard information corresponding to the matching information in a preset standard database, and outputting a warning trigger signal when the matching information is inconsistent with the standard information.
As a further improvement of an embodiment of the present invention, the page monitoring method further includes: acquiring a page address of the page and an interface address corresponding to the page, and initializing the page; acquiring all field value information in the page according to the page address, and storing the field value information as a plurality of pieces of standard field value information; according to the interface address, obtaining return values of all the interfaces and storing the return values as a plurality of pieces of standard interface information; matching operation is respectively carried out on the plurality of pieces of standard field value information and the plurality of pieces of standard interface information, and a plurality of pieces of standard information are generated; and establishing a standard database according to the plurality of pieces of standard information.
As a further improvement of an embodiment of the present invention, the page monitoring method specifically includes: according to the interface address, return values of all interfaces are obtained, and business object screening is executed to obtain a plurality of pieces of original field value information; performing page rendering on the original field value information to initialize the page.
As a further improvement of an embodiment of the present invention, the page monitoring method specifically includes: updating the page, and traversing all information in the page to obtain page information; dividing the page information to obtain at least one piece of field value information and establishing an index list; acquiring at least one piece of interface information corresponding to the field value information according to the index list; and combining the mutually matched field value information and the interface information to generate at least one piece of matching information.
As a further improvement of an embodiment of the present invention, the page monitoring method further includes: receiving the warning trigger signal, and segmenting and comparing the contents of the matching information and the standard information; if the matching information comprises a first field and the standard information is recorded as a null or a second field at the position of the first field, updating the first field to the corresponding position in the standard information and typing a warning identifier in the updated standard information; wherein the second field is not consistent with the first field.
As a further improvement of an embodiment of the present invention, the field value information and the interface information are configured as key value pairs and respectively include a first numerical value and a second numerical value, and positions in the standard information corresponding to the first numerical value and the second numerical value are both configured as a third numerical value; the page monitoring method further comprises: receiving the warning trigger signal, and segmenting and comparing the contents of the matching information and the standard information; if at least one of the first numerical value and the second numerical value is not equal to the third numerical value, updating the third numerical value to be the second numerical value, and entering a warning identifier into the standard information to generate first standard information; judging whether the first standard information is consistent with the matching information; if the first standard information is inconsistent with the second standard information, updating a second numerical value in the first standard information to be a first numerical value, and generating second standard information; and if the first standard information is consistent with the second standard information, clearing the warning identifier in the first standard information, and storing the warning identifier in the standard database.
As a further improvement of an embodiment of the present invention, the page monitoring method further includes: judging whether the second standard information is consistent with the matching information; if not, outputting the second standard information and the intervention application message; and if the first standard information is consistent with the second standard information, clearing the warning identifier in the second standard information, and storing the warning identifier in the standard database.
To achieve one of the above objects, an embodiment of the present invention provides a page monitoring apparatus, including: the page crawling module is used for acquiring at least one piece of field value information in a page; the interface analysis module is used for acquiring at least one piece of interface information corresponding to the field value information; the matching execution module is used for executing matching operation on the field value information and the interface information and generating at least one piece of matching information; and the retrieval judging module is used for searching standard information corresponding to the matching information in a preset standard database and outputting an alarm triggering signal when the matching information is inconsistent with the standard information.
In order to achieve one of the above objects, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used for storing a computer program; the processor is configured to implement the steps of the page monitoring method according to any one of the above technical solutions when executing the program stored in the memory.
In order to achieve one of the above objects, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the page monitoring method according to any one of the above technical solutions.
Compared with the prior art, the page monitoring method provided by the invention has the advantages that the field value information from the page and the interface information from the interface are matched, and the matching information generated by matching is compared with the standard information in the preset standard database, so that the matching condition between the page information and the interface information can be simultaneously checked, the page information and the interface information can be respectively compared with the prestored information, and a double-layer checking logic architecture is formed, thereby ensuring the high speed and effectiveness of the page monitoring process, avoiding manual intervention and sufficiently coping with the complex conditions of errors of the dynamic page and the interface and the like.
Drawings
FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a page monitoring apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the steps of a page monitoring method in one embodiment of the present invention;
FIG. 4 is a schematic diagram of the steps of a page monitoring method in another embodiment of the present invention;
FIG. 5 is a schematic diagram of the steps of a page monitoring method in accordance with yet another embodiment of the present invention;
FIG. 6 is a schematic diagram of the steps of a first embodiment of a page monitoring method in one embodiment of the present invention;
FIG. 7 is a partial schematic step diagram of steps 31 through 344 of a second example of a page monitoring method in accordance with an embodiment of the present invention;
fig. 8 is a partial step schematic diagram of steps 344A to 346 of a second example of a page monitoring method according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to specific embodiments shown in the drawings. These embodiments are not intended to limit the present invention, and structural, methodological, or functional changes made by those skilled in the art according to these embodiments are included in the scope of the present invention.
It is to be noted that the term "comprises," "comprising," or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Furthermore, the terms "first," "second," "third," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
H5 is a language description way of building Web content, and since it is commonly used for developing Web pages for mobile applications, such pages are collectively referred to as H5 pages, providing functionality for dynamic interaction on the page without downloading third party software. The principle of the method is that according to a preset address, a request is sent to a predefined interface and return information is correspondingly received, the return information is backfilled to a page template, and page rendering is executed, so that functions of page display, dynamic interaction and the like are achieved.
In particular, the address may include a URL (Uniform Resource Locator) address, which typically includes a Resource type, a host domain name and a Resource file name for storing the Resource, or portions of a protocol, a host, a port, and a path. The Interface may include an API (Application Programming Interface), and a user may establish a contract for linking different components of the software system through a predefined function Interface or an HTTP (hypertext Transfer Protocol) Interface, so as to provide a routine for accessing software or hardware.
The page rendering process may include a JavaScript rendering process, and specifically may include: acquiring an HTML tag, calling an HTML parser to parse the HTML tag into a Token and correspondingly creating a DOM (Document Object Model) tree; acquiring a Style label or a link label, calling a CSS (Cascading Style Sheets) parser to parse, and correspondingly creating a CSS tree; acquiring a script tag, calling a JavaScript parser to process and correspondingly bind an event, a DOM tree or a CSS tree; combining the DOM tree and the CSS tree to generate a rendering tree; and calculating node information according to the rendering tree and drawing the node information to a page. Of course, the present invention may also include other embodiments, and the technical effects of acquiring data and rendering a page described above can also be achieved.
Rendering and monitoring a page comprising various embedded programs can be performed through a Web vulnerability scanning tool AppScan, program operation and response test can be performed on the page, and code logic self-consistency is analyzed. However, it is impossible to monitor information on a page, and particularly, for monitoring a page that mainly displays field information and can be edited or adjusted in a replacement manner, whether a field value in the page is matched with an interface return value or not, whether a dynamic change of the page is always within a preset adjustable range or not, manual checking and verification are required, and problems of hysteresis, narrow coverage, poor accuracy and the like often exist.
In order to solve the above problems and other problems, and in accordance with the purpose of the present invention, a computer-readable storage medium, which is configured in a computer and stores a computer program, may be any available medium that can be accessed by the computer, or may be a storage device such as a server, a data center, etc. that includes one or more available media. The usable medium may be a magnetic medium such as a floppy Disk, a hard Disk, a magnetic tape, or the like, or an optical medium such as a DVD (Digital Video Disc), or a semiconductor medium such as an SSD (Solid State Disk). When executed by any processor in a computer, the computer program implements a page monitoring method to perform on a page: matching field value information and interface information, generating matching information, comparing and judging standard information and matching information, outputting a warning trigger signal and the like.
An embodiment of the present invention further provides an electronic device 100 as shown in fig. 1, where the electronic device 100 includes a processor 11, a communication interface 12, a memory 13, and a communication bus 14. The processor 11, the communication interface 12 and the memory 13 are communicated with each other through a communication bus 14.
Wherein, the memory 13 is used for storing computer programs; the processor 11 is adapted to execute a program stored in the memory, which may be a computer program stored on a computer readable storage medium as described above. When executing the program, the processor 11 may implement a page monitoring method, which specifically includes: matching field value information and interface information, generating matching information, comparing and judging standard information and matching information, outputting a warning trigger signal and the like.
Specifically, the communication bus 14 may be a PCI bus (Peripheral Component Interconnect) or an EISA bus (Extended Industry Standard Architecture) or the like. The communication bus 14 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 1, but it is not intended that there be only one bus or one type of bus.
The communication interface 12 is used for communication between the above-described electronic apparatus 100 and other apparatuses.
The Memory 13 may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Alternatively, the memory 13 may be at least one storage device disposed remotely from the aforementioned processor 11.
The Processor 11 may be a general-purpose Processor including a CPU (Central Processing Unit), an NP (Network Processor), etc., and may also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
An embodiment of the present invention further provides a page monitoring apparatus 200 as shown in fig. 2, where the page monitoring apparatus 200 includes a page crawling module 21, an interface analyzing module 22, a matching executing module 23, and a retrieval determining module 24.
The page crawling module 21 is configured to obtain at least one piece of field value information in a page, the interface analyzing module 22 is configured to obtain at least one piece of interface information corresponding to the field value information, the matching executing module 23 is configured to execute a matching operation on the field value information and the interface information and generate at least one piece of matching information, and the retrieval determining module 24 is configured to search a preset standard database for standard information corresponding to the matching information and output an alarm trigger signal when the matching information is inconsistent with the standard information.
Specifically, the page crawling module 21 may further be configured to obtain page information and build an index list according to the field value information. The interface analysis module 22 may also be configured to obtain interface information according to the index list. The matching performing module 23 may also be used to combine the field value information and the interface information and generate matching information.
Of course, the page monitoring apparatus 200 may further include a filtering rendering module, an editing processing module, and an information storage module. Preferably, the screening rendering module is connected to the page crawling module 21, and the editing processing module is connected to the retrieval judging module 24. And the screening and rendering module is used for acquiring a return value of the interface according to the interface address, executing service object screening and executing page rendering according to the original field value information. The editing processing module is used for receiving the signal output by the retrieval judging module 24, dividing and comparing the contents of the matching information and the standard information, and correspondingly editing the standard information according to the field configuration condition and the numerical value content of the two kinds of information. The information processing module is used for storing programs of the control page crawling module 21, the interface analysis module 22 and the matching execution module 23 and storing the standard database.
As shown in fig. 3, a program or a command corresponding to the method may be loaded on the computer-readable storage medium and/or the electronic device 100 and/or the page monitoring apparatus 200 to achieve the technical effect of page monitoring. The method specifically comprises the following steps:
step 31, updating the page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information;
the amount of field value information obtained may depend on the size of the area in the page to be monitored and the operator's choice. Specifically, all field value information on the page may be selectively obtained for monitoring, field values of partial areas in the page may also be obtained for monitoring, or only one extremely important field value in the page may be monitored. Notably, in the monitoring process, the original field value information and interface information of the page and the interface are not changed, so that the user can still use the page and perform interaction in the monitoring process.
In one embodiment, the method for obtaining field value information in a page may be configured to be implemented by using an XPath (Extensible Markup Language document Path Language) syntax. The method specifically comprises the following steps: importing an analysis module; acquiring a node where a source code locks an interested content; and converting the interested content into a target format and outputting and displaying the target format. The parsing module may be an E-Tree (Element Tree) in one embodiment, and the target format may be a text format.
As described above, the interface information may be configured as API interface return value information, and in an embodiment, the manner of obtaining the interface information may be configured to be implemented by using child items such as Http-Client, Http-URL-Connection, OK-Http, and Volley, or may be implemented by packaging a function for obtaining the interface information, or by using custom script code. In the embodiment that the interface is configured as an API interface, the return value accessed and obtained by the field value information and the interface address in the page is usually in a JSON (JavaScript Object Notation) format, an array format or a string format, and therefore, when matching is performed on the interface information and the field value information and matching information is generated, a format conversion step may be added to the function. In addition, the step of acquiring the field value information in the page and the step of acquiring the interface information returned by the interface may be executed simultaneously, or may be configured to be executed sequentially according to the needs of those skilled in the art.
In one embodiment, the matching operation may include checking a content correspondence of the field value information and the interface information. In the embodiment that the field value information is configured in a key-value pair form, or "tag + value" form, the way of looking up the corresponding interface information with the field value information as a reference may be to look up the tag content. Based on this, the matching operation may include: and checking whether the numerical value in the field value information and the numerical value in the corresponding interface information are consistent. Of course, in another embodiment, the matching may also include only: and searching corresponding interface information and establishing a corresponding relation between the interface information and field value information.
In one embodiment, the matching information may include all contents of the field value information and the corresponding interface information, so that the field value information and the interface information are respectively checked for contents, checked for mutual matching relationship, and monitored for dynamic changes.
And step 32, searching standard information corresponding to the matching information in a preset standard database, and outputting an alarm trigger signal when the matching information is inconsistent with the standard information.
After the field value information and the interface information are matched, effective information in the field value information can be determined, and matching information is generated by taking the field value information and the interface information as contents, wherein the matching information represents that: and executing the conditions of the field value and the interface return value in the page in the current state after the page is updated.
The standard information actually contains field value information and interface information, and the composition structure of the standard information is the same as that of the matching information, but there may be differences in specific contents, specifically, there are the following two cases:
firstly, in the case that the page is configured not to allow editing and modification, the field value information and/or the interface information in the matching information is tampered maliciously, so that the current matching information is inconsistent with the matching information (i.e. the preset standard information) that the operator wants to keep all the time. That is, when the page is not changed, the matching information is inconsistent with the standard information.
Secondly, under the condition that the page configuration is dynamically changed or the front end can accept user editing, the field value information and/or the interface information in the matching information is modified by the front end, so that the field value information or the interface information in the current matching information is inconsistent with the field value information or the interface information in the previous state or defined by an operator (namely, the field value information or the interface information in the standard information). That is, when the page changes, the matching information is inconsistent with the standard information.
In order to dynamically monitor the field value information condition and the interface information condition in the page, in the case of inconsistency between the two, a warning trigger signal needs to be output to prompt an operator or trigger other execution programs. In one embodiment, the mode of prompting the operator may be pop-up window, graphical mark, etc., and the other execution program may be a re-check program for checking the consistency between the matching information and the standard information, or an editing processing program for the standard information.
Of course, this embodiment provided by the present invention may further include: and (5) performing iterative traversal until all (selected) field value information and corresponding interface information complete related operations, and performing iterative traversal until all (selected) matching information and standard information complete related operations. Of course, the matching failure condition may include a condition that the field is empty, the field content is incorrect (may include a value error, a format error, or other display errors), and may also include a condition that the page is lost or the page is loaded with blank and has no data, and any of the above conditions may be monitored by executing step 31 to step 32.
Another embodiment of the present invention provides a refined page monitoring method, as shown in fig. 4, including:
step 301, acquiring a page address of a page and an interface address corresponding to the page, and initializing the page;
step 302, acquiring all field value information in a page according to a page address, and storing the field value information as a plurality of pieces of standard field value information;
step 303, obtaining return values of all interfaces according to the interface addresses, and storing the return values as a plurality of pieces of standard interface information;
step 304, performing matching operation on the plurality of pieces of standard field value information and the plurality of pieces of standard interface information respectively to generate a plurality of pieces of standard information;
305, establishing a standard database according to a plurality of pieces of standard information;
step 31, updating the page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information;
and step 32, searching standard information corresponding to the matching information in a preset standard database, and outputting an alarm trigger signal when the matching information is inconsistent with the standard information.
As described above, the page address and the interface address may be configured as a URL address, respectively. In the process of initializing the page and establishing the standard database, on one hand, the interface address corresponding to the page can be accessed, the mapping is executed after the interface return value is obtained from the interface, and the page rendering is executed on the mapped return value so as to initialize the page; on the other hand, after the page is initialized, preferably, any of the field value information crawling methods and any of the interface information acquiring methods described above are simultaneously implemented, all the field value information and the return values of all the interfaces in the page are obtained and are correspondingly stored as the standard field value information and the standard interface information.
It is emphasized that the in-page field value information described herein may include not only field value information actually rendered and displayed in a page, but also field value information included at a page address but not actually displayed (selectively hidden). Based on this, the number of the standard interface information may be greater than or equal to the number of the standard field value information. Similarly, the above-described numerical relationship between the field value information after updating the page and the interface information may be present.
And at least part of contents in the standard field value information are used as indexes to match the associated standard interface information to generate standard information, and a standard database is established by using the standard information for searching the updated matching information. Therefore, on one hand, whether the information changes or not can be monitored in real time for the static page; on the other hand, the information change degree can be monitored in real time for a dynamic page, and each retrieval and monitoring is configured to simultaneously target field value information and interface information.
As shown in fig. 4, in this embodiment, step 301 may further include:
step 3011, according to the interface address, obtaining the return values of all interfaces and performing service object screening to obtain multiple pieces of original field value information;
in step 3012, page rendering is performed on the original field value information to initialize the page.
Because the data volume of the interface return values is huge, not all the interface return values need to enter the page rendering, a business object screening step can be configured at the front end, part of the interface return values needed by the page rendering can be screened according to a self-defined condition, and the interface return values are defined as an intermediate volume of the original field value information.
The screening process can be implemented by writing script code or functions according to the needs of those skilled in the art. In one embodiment, the business object screening process may be configured to: acquiring a list of all objects; adding a cache; traversing the interface return value and judging whether the interface return value meets a preset first condition, and if so, adding a first meeting mark; and iterating and traversing all conditions of all interface return values, and adding the interface return values into the list if the number of the conforming marks of the interface return values meets the preset conditions.
Of course, the embodiment provided by the present invention may further include the step of performing an iterative traversal until all (selected) field value information and corresponding interface information complete the related operation, and performing an iterative traversal until all (selected) matching information and standard information complete the related operation.
Still another embodiment of the present invention provides a detailed page monitoring method, as shown in fig. 5, including:
step 311, updating the page, and traversing all information in the page to obtain page information;
step 312, dividing the page information to obtain at least one field value information and establishing an index list;
step 313, acquiring at least one piece of interface information corresponding to the field value information according to the index list;
step 314, combining the mutually matched field value information and interface information to generate at least one piece of matching information;
and step 32, searching standard information corresponding to the matching information in a preset standard database, and outputting an alarm trigger signal when the matching information is inconsistent with the standard information.
The field value information in the page is often displayed and acquired in a row-column manner, and the number of interfaces corresponding to the field values in multiple rows may be one or more. Therefore, the updated page information of the whole page needs to be segmented according to the preset conditions and an index list is established according to the preset rules, so as to form corresponding association with the interface. When the above process is implemented by using XPath syntax, taking an implementation of building an index list according to the type of field value information as a classification standard as an example, the following statements may be included:
Xpath->//div[@class=”xxx”][%d]//*[text()];
therefore, the corresponding interface information can be obtained through matching according to the index list containing the field value information, and the matching speed and the monitoring effect are improved. In one embodiment, the above matching process may include directly combining the field value information and the interface information to form the matching information in the form of "interface information + field value information".
Of course, the embodiment provided by the present invention may further include the step of performing an iterative traversal until all (selected) field value information and corresponding interface information complete the related operation, and performing an iterative traversal until all (selected) matching information and standard information complete the related operation.
In an embodiment of the present invention, a first embodiment of the page monitoring method is provided to refine a subsequent action of outputting an alert trigger signal, as shown in fig. 6, specifically including:
step 31, updating the page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information;
step 32, searching standard information corresponding to the matching information in a preset standard database, and outputting an alarm trigger signal when the matching information is inconsistent with the standard information;
step 331, receiving the warning trigger signal, and segmenting and comparing the contents of the matching information and the standard information;
step 332, if the matching information includes the first field and the standard information is recorded as empty or the second field at the position of the first field, updating the first field to the corresponding position in the standard information, and entering the warning identifier into the updated standard information.
For the first case, the match information is described as a first field at the first location and the standard information is described as empty at the first location. This may be the case: the front-end input desirably causes the first field, which is not displayed in the original initialized page state, to be exposed for display, and thus the first field needs to be added to the first position in the standard information to update the standard information that is delayed.
For the second case, the match information is described as a first field at the first location and the standard information is described as a second field at the first location that is inconsistent with the first field. This may be the case: the field of the first position in the standard information is in error in the initialization process, or the matching information is in error due to malicious tampering in the acquisition process. Since it is impossible to determine which of the standard information and the matching information is erroneous, the present embodiment may preferentially modify the standard information according to the matching information.
Further describing the present solution in conjunction with the generation process of the matching information, an embodiment may be specifically configured to:
updating the page, and traversing all information in the page to obtain page information;
dividing the page to obtain at least one piece of field value information, and establishing an index list by using a type tag in the field value information;
accessing a corresponding interface according to the index list and acquiring a return value to obtain at least one piece of interface information;
checking values of the mutually matched field value information and the interface information corresponding to the type labels, if the values are equal, combining the field value information and the interface information to generate at least one piece of matching information, and if the values are not equal, outputting the field value information, the interface information, the error type and the intervention application message;
searching standard information corresponding to the matching information in a preset standard database, if the matching information is not consistent with the standard information, outputting a warning trigger signal, and if the matching information is consistent with the standard information, skipping to process next field value information and corresponding interface information;
receiving an alarm trigger signal, and segmenting and comparing the contents of the matching information and the standard information;
if the first position in the matching information is recorded as a first field and the first position corresponding to the standard information is recorded as a null or a second field, updating the first field to the first position in the standard information and typing a warning identifier into the updated standard information;
judging whether the updated standard information is consistent with the matching information, if so, clearing the warning identifier in the standard information, and skipping to process other matching information and corresponding standard information; and if the standard information is inconsistent with the error type, outputting the updated standard information, the updated error type and the updated intervention application message.
Of course, the embodiment provided by the present invention may further include the step of performing an iterative traversal until all (selected) field value information and corresponding interface information complete the related operation, and performing an iterative traversal until all (selected) matching information and standard information complete the related operation.
In an embodiment of the present invention, a second embodiment of the page monitoring method is provided to refine matching information and standard information to perform matching operation, where another possible situation exists, as shown in fig. 7 and 8, specifically including:
step 31, updating the page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information;
step 32, searching standard information corresponding to the matching information in a preset standard database, and outputting an alarm trigger signal when the matching information is inconsistent with the standard information;
step 341, receiving the warning trigger signal, dividing and comparing the content of the matching information and the standard information;
step 342, if at least one of the first numerical value and the second numerical value is not equal to the third numerical value, updating the third numerical value to be the second numerical value, inputting a warning identifier into the standard information, and generating first standard information;
step 343, judging whether the first standard information is consistent with the matching information;
step 344, if the first standard information is not consistent with the second standard information, updating (step 344A) a second numerical value in the first standard information to be a first numerical value, and generating second standard information; if so, the alert identifier in the first criteria information is cleared (step 344B) and stored in the criteria database.
The embodiment is based on the fact that the field value information and the interface information are configured as key value pairs, the field value information comprises a first label and a first numerical value, the interface information comprises a second label and a second numerical value, and the steps of initializing the page and establishing the standard database are correctly performed. At this time, a problem occurs in that the positions corresponding to the first numerical value and the second numerical value in the standard information are both wrong third numerical values, that is, the standard information is configured in the form of "a third label, a third numerical value, a fourth label, and a third numerical value".
In the embodiment in which the association between the field value information and the interface information and between the matching information and the standard information are configured to be established with the tag as an index, the first tag, the second tag, the third tag, and the fourth tag are all the same when the step of acquiring the related information is correctly performed. Thus, the case where the matching information is inconsistent with the standard information may include two kinds: first, the first value is inconsistent with the third value; and secondly, the second value is not consistent with the third value.
If at least one of the first value and the second value is not equal to the third value, the first standard message is preferably generated by updating the third value in the standard message to the second value in the interface message and entering a warning identifier into the standard message.
At this time, if the standard information is defined as "key-value 3-key-value 3", the interface information is defined as "key-value 2", the field value information is defined as "key-value 1", and the warning identifier is defined as "F", then: the matching information is "key-value 2-key-value 1"; after step 342, the standard information is edited into the first standard information in the form of "key-value 2-key-value 2-F". Therefore, the interface information with smaller error probability is selected as the revision value to be edited while the warning identifier for representing the field error is kept.
Continuing to step 343 to step 344, if the first criterion information is consistent with the matching information, that is, the first value1 is equal to the second value2, the warning identifier in the first criterion information is cleared, and "key-value 2-key-value 2" is stored in the criterion database, and the process jumps to process other matching information and corresponding criterion information. And if the first standard information is inconsistent with the matching information, the probability of the interface information is wrong, at the moment, the second numerical value in the first standard information is updated to be the first numerical value, and the second standard information in the shape of 'key-value 1-key-value 1-F' is generated.
Of course, it should be noted that when the first criterion information and the matching information determining procedure is executed, the original matching information and the original first criterion information generated by the original matching information may be determined, or the original first criterion information and the updated new matching information may be determined, that is, the "key-value 2-key-value 2-F" and the "key-value 2-key-value 1" are compared and determined. The above process may be a dynamic process, which is sufficient to implement real-time monitoring of the matching information. Meanwhile, in the process of judging consistency, the warning identifier carried in the standard information needs to be shielded, and the other parts are used as objects to execute matching judgment.
It is understood that, in the process of implementing the above technical solution, the technical solution provided by any of the foregoing embodiments or examples may be added and/or implemented alternatively. For example, the foregoing process may be interspersed with implementing the following: the method comprises the steps of the form of field value information, interface information, matching information and standard information, a page rendering step, a standard database establishing step, a page field value information acquiring step, an interface information acquiring step, a field value information and interface information matching step, a matching information and standard information judging step and the like.
Continuing, after step 344A, may also include:
step 345, determining whether the second standard information is consistent with the matching information;
step 346, if not, outputting (step 346A) second standard information and an intervention application message; if so, the alert identifier in the second criteria information is cleared (step 346B) and stored in the criteria database.
As defined above, if the updated second criterion information is consistent with the matching information, "key-value 1-key-value 1" stores the value in the criterion database, and jumps to process other matching information and corresponding criterion information, and if the updated second criterion information is not consistent with the matching information, the second criterion information in the form of "key-value 1-key-value 1-F" and the intervention application message are output.
Of course, the embodiment provided by the present invention may further include the step of performing an iterative traversal until all (selected) field value information and corresponding interface information complete the related operation, and performing an iterative traversal until all (selected) matching information and standard information complete the related operation.
The definitions of the intervention application message herein apply throughout, all characterizing: and under the condition that the front end and the rear end of the page are matched and cannot realize self-adaptive adjustment and eliminate warning, actively sending an application message for requesting the intervention of an operator. Thereby artificially locking where a problem occurs in the field value information, the interface information, the standard field value information, and the standard interface information.
In a detailed embodiment of the present invention, the method may further include a step of visually displaying the data, specifically:
traversing all standard information stored in a standard database;
counting the number of the warning identifiers in all the standard information;
judging whether the number of the warning identifiers exceeds a set threshold value or not;
tracking the positions of the warning identifiers exceeding the set threshold number in the standard database, locking corresponding standard information and extracting time information;
and establishing one or more visual graphs such as a time-error reporting quantity bar chart, a line chart and the like by taking at least the extracted time information as a horizontal coordinate and the number of the corresponding warning identifiers as a vertical coordinate.
Without departing from the inventive concept, the algorithms of implementing time stamping, quantitative statistics and the like can be transformed to generate a monitoring table comprising sequence number-name-title-URL address-last execution time-execution result-24 hour calling times-development operation, and/or a bar chart or a line chart of time-H5 test case overall passing rate, and/or a bar chart or a line chart of time-single case, and/or a bar chart or a line chart of time-H5 test case total consumption, and/or a time-single case consumption trend chart.
The name is defined to comprise a field similar to 'company-case-info', the title is defined to be specific information such as 'court announcement information' or 'enterprise project information', the URL address is defined to be a link of 'https:// … …', the latest sequential execution time is defined to be information including year, month, day and specific time such as 'YYYY-MM-DD HH-MM-SS', and the use case or the test case is defined to correspond to one or more H5 pages including enterprise information.
Therefore, all data can be dynamically displayed in a graphical mode, dynamic relations of a plurality of groups of data at different moments are connected in series, and a projection platform forms trend display, so that an operator can visually see fluctuation of the data, and reliability, integrity and stability of the data are evaluated. Meanwhile, a warning line can be set, and data exceeding the warning line (or called threshold) are collected at time points, so that the time law is summarized and timely investigation is carried out.
In summary, according to the page monitoring method provided by the present invention, by performing matching on field value information from a page and interface information from an interface and comparing matching information generated by matching with standard information in a preset standard database, not only can matching conditions between the page information and the interface information be checked simultaneously, but also the page information and the interface information can be compared with prestored information respectively, so as to form a double-layer check logic architecture, thereby ensuring high speed and effectiveness of a page monitoring process, avoiding manual intervention, and sufficiently coping with complex conditions such as errors of a dynamic page and an interface.
It should be understood that although the present description refers to embodiments, not every embodiment contains only a single technical solution, and such description is for clarity only, and those skilled in the art should make the description as a whole, and the technical solutions in the embodiments can also be combined appropriately to form other embodiments understood by those skilled in the art.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of page monitoring, comprising:
updating a page, acquiring at least one piece of field value information in the page and at least one piece of interface information corresponding to the field value information, and performing matching operation on the field value information and the interface information to generate at least one piece of matching information;
searching standard information corresponding to the matching information in a preset standard database, and outputting a warning trigger signal when the matching information is inconsistent with the standard information;
the matching operation comprises checking the content corresponding relation between the field value information and the interface information, and checking whether the numerical value in the field value information is consistent with the numerical value in the corresponding interface information; the matching information includes all contents of the field value information and the interface information.
2. The page monitoring method of claim 1, further comprising:
acquiring a page address of the page and an interface address corresponding to the page, and initializing the page;
acquiring all field value information in the page according to the page address, and storing the field value information as a plurality of pieces of standard field value information;
according to the interface address, obtaining return values of all the interfaces and storing the return values as a plurality of pieces of standard interface information;
matching operation is respectively carried out on the plurality of pieces of standard field value information and the plurality of pieces of standard interface information, and a plurality of pieces of standard information are generated;
and establishing a standard database according to the plurality of pieces of standard information.
3. The page monitoring method according to claim 2, wherein the page monitoring method specifically comprises:
according to the interface address, return values of all interfaces are obtained, and business object screening is executed to obtain a plurality of pieces of original field value information;
performing page rendering on the original field value information to initialize the page.
4. The page monitoring method according to claim 1, wherein the page monitoring method specifically comprises:
updating the page, and traversing all information in the page to obtain page information;
dividing the page information to obtain at least one piece of field value information and establishing an index list;
acquiring at least one piece of interface information corresponding to the field value information according to the index list;
and combining the mutually matched field value information and the interface information to generate at least one piece of matching information.
5. The page monitoring method of claim 1, further comprising:
receiving the warning trigger signal, and segmenting and comparing the contents of the matching information and the standard information;
if the matching information comprises a first field and the standard information is recorded as a null or a second field at the position of the first field, updating the first field to the corresponding position in the standard information and typing a warning identifier in the updated standard information; wherein the second field is not consistent with the first field.
6. The page monitoring method according to claim 1, wherein said field value information and said interface information are configured as key value pairs and respectively include a first numerical value and a second numerical value, and positions in said standard information corresponding to said first numerical value and said second numerical value are configured as a third numerical value; the page monitoring method further comprises:
receiving the warning trigger signal, and segmenting and comparing the contents of the matching information and the standard information;
if at least one of the first numerical value and the second numerical value is not equal to the third numerical value, updating the third numerical value to be the second numerical value, and entering a warning identifier into the standard information to generate first standard information;
judging whether the first standard information is consistent with the matching information;
if the first standard information is inconsistent with the second standard information, updating a second numerical value in the first standard information to be a first numerical value, and generating second standard information;
and if the first standard information is consistent with the second standard information, clearing the warning identifier in the first standard information, and storing the warning identifier in the standard database.
7. The page monitoring method of claim 6, further comprising:
judging whether the second standard information is consistent with the matching information;
if not, outputting the second standard information and the intervention application message;
and if the first standard information is consistent with the second standard information, clearing the warning identifier in the second standard information, and storing the warning identifier in the standard database.
8. A page monitoring apparatus, comprising:
the page crawling module is used for acquiring at least one piece of field value information in a page;
the interface analysis module is used for acquiring at least one piece of interface information corresponding to the field value information;
the matching execution module is used for executing matching operation on the field value information and the interface information and generating at least one piece of matching information;
the retrieval judging module is used for searching standard information corresponding to the matching information in a preset standard database and outputting a warning triggering signal when the matching information is inconsistent with the standard information;
the matching operation comprises checking the content corresponding relation between the field value information and the interface information, and checking whether the numerical value in the field value information is consistent with the numerical value in the corresponding interface information; the matching information includes all contents of the field value information and the interface information.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the page monitoring method steps of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the page monitoring method steps of any one of claims 1 to 7.
CN202111296738.3A 2021-11-04 2021-11-04 Page monitoring method, device, equipment and computer readable storage medium Active CN113722191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111296738.3A CN113722191B (en) 2021-11-04 2021-11-04 Page monitoring method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111296738.3A CN113722191B (en) 2021-11-04 2021-11-04 Page monitoring method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113722191A CN113722191A (en) 2021-11-30
CN113722191B true CN113722191B (en) 2022-03-04

Family

ID=78686668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111296738.3A Active CN113722191B (en) 2021-11-04 2021-11-04 Page monitoring method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113722191B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780595B (en) * 2022-05-09 2023-08-15 马上消费金融股份有限公司 Verification method, verification device and verification system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107846321A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 A kind of monitoring method of interface, device and electronic equipment
CN109408379A (en) * 2018-09-30 2019-03-01 福建星瑞格软件有限公司 One kind is based on promotion jmeter interface automatic test data matching method
CN111104313A (en) * 2019-11-21 2020-05-05 苏州浪潮智能科技有限公司 Automatic testing method, system and equipment for REST API (representational State transfer) interface
CN111859231A (en) * 2019-04-30 2020-10-30 中移(苏州)软件技术有限公司 Webpage monitoring method, equipment, device and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107846321A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 A kind of monitoring method of interface, device and electronic equipment
CN109408379A (en) * 2018-09-30 2019-03-01 福建星瑞格软件有限公司 One kind is based on promotion jmeter interface automatic test data matching method
CN111859231A (en) * 2019-04-30 2020-10-30 中移(苏州)软件技术有限公司 Webpage monitoring method, equipment, device and computer storage medium
CN111104313A (en) * 2019-11-21 2020-05-05 苏州浪潮智能科技有限公司 Automatic testing method, system and equipment for REST API (representational State transfer) interface

Also Published As

Publication number Publication date
CN113722191A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
US7441195B2 (en) Associating website clicks with links on a web page
US10613971B1 (en) Autonomous testing of web-based applications
JP6036100B2 (en) Step-by-step visual comparison of web browser screens
US9245274B2 (en) Identifying selected dynamic content regions
CN111046317A (en) Page data acquisition method, device, equipment and computer readable storage medium
AU2004217115B2 (en) Associating website clicks with links on a web page
CN110688307B (en) JavaScript code detection method, device, equipment and storage medium
US20110119220A1 (en) Rule-based validation of websites
US20080281834A1 (en) Block tracking mechanism for web personalization
CN111130845B (en) Method and device for testing IPv6 support degree of website page based on visual information
CN111125598A (en) Intelligent data query method, device, equipment and storage medium
US10146749B2 (en) Tracking JavaScript actions
US11100069B2 (en) Element identification in a tree data structure
CN113535587B (en) Target application detection method and device and computer equipment
CN113722191B (en) Page monitoring method, device, equipment and computer readable storage medium
US9081865B2 (en) Identifying selected elements in dynamic content
KR20100069147A (en) Method and apparatus for testing quality of website
CN115455013A (en) Method, system, computer equipment and medium for automatically updating dynamic form
US20210200833A1 (en) Health diagnostics and analytics for object repositories
US10788959B2 (en) Personalization of a web application
CN114996212B (en) Method, apparatus, device and medium for managing elements in electronic book
CN100437740C (en) Associating website clicks with links on a web page
US20240054174A1 (en) Methods and systems for obtaining and storing web pages
US11416381B2 (en) Supporting web components in a web testing environment
CN117909007A (en) Page dynamic delivery method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No. 8 Huizhi Street, Suzhou Industrial Park, Suzhou Area, China (Jiangsu) Pilot Free Trade Zone, Suzhou City, Jiangsu Province, 215000

Patentee after: Qichacha Technology Co.,Ltd.

Address before: Room 503, 5th floor, C1 Building, 88 Dongchang Road, Suzhou Industrial Park, Jiangsu Province, 215000

Patentee before: Qicha Technology Co.,Ltd.