CN111078519A - Method and device for backtracking abnormal monitoring behaviors and electronic equipment - Google Patents

Method and device for backtracking abnormal monitoring behaviors and electronic equipment Download PDF

Info

Publication number
CN111078519A
CN111078519A CN201911289534.XA CN201911289534A CN111078519A CN 111078519 A CN111078519 A CN 111078519A CN 201911289534 A CN201911289534 A CN 201911289534A CN 111078519 A CN111078519 A CN 111078519A
Authority
CN
China
Prior art keywords
dom
object model
document object
initial
operation behavior
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.)
Pending
Application number
CN201911289534.XA
Other languages
Chinese (zh)
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.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity 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 DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN201911289534.XA priority Critical patent/CN111078519A/en
Publication of CN111078519A publication Critical patent/CN111078519A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a method, a device and electronic equipment for backtracking an abnormal monitoring behavior, and relates to the field of network monitoring, wherein the method records an initial Document Object Model (DOM) structure at a recording moment in advance, and determines a changed part of the DOM structure of the initial document object model caused by the operation behavior by monitoring the operation behavior of a user; and finally, playing back the Document Object Model (DOM) based on the initial DOM structure, the operation behavior and the changed part. The method is simple to operate, reduces the network overhead, and solves the problems of high complexity and high network overhead in the prior art. In addition, when monitoring, the method can determine the abnormity or problem caused by the behavior of the user mode without inquiring the user, thereby realizing accurate recurrence of the abnormity or problem, accurately positioning the abnormity or problem and facilitating the solution of the abnormity or problem.

Description

Method and device for backtracking abnormal monitoring behaviors and electronic equipment
Technical Field
The invention relates to the field of monitoring, in particular to a method and a device for backtracking an abnormal monitoring behavior and electronic equipment.
Background
After a problem occurs in an ordinary daily customer environment, the customer environment is generally logged in through a remote operation tool for reproduction and debugging, but if the customer is in an intranet environment, the debugging is more difficult, and if the problem is sporadic, the reproduction is almost difficult, under the condition, after abnormal information monitoring is carried out on information capture, an abnormal site is restored, the whole appearance of the problem is restored, and the problem is more easily solved.
The backtracking of the current abnormal monitoring behavior is mainly realized by a canvs screenshot method, and the process is as follows: 1. collecting a Document Object Model (DOM) and storing the DOM in a queue; 2. drawing document object models DOM and css into Canvas; 3. the screenshot is collected, and the picture is generated to play and replay by frames, however, the method has the following defects: the realization is complex, if a smooth video is required to be generated, 24 screenshots need to be generated in one second, the number of pictures is too many, and the network overhead is too large.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and an electronic device for tracing back an abnormal monitoring behavior, so as to alleviate the problems of high complexity and high network overhead in the prior art.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment provides a method for backtracking an abnormal monitoring behavior, which records an initial document object model DOM structure at a recording moment in advance; the method comprises the following steps:
monitoring the operation behavior of a user;
determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure;
and playing back the Document Object Model (DOM) based on the initial DOM structure, the operation behavior and the changed part.
In an optional embodiment, after the step of monitoring the operation behavior of the user, the method further comprises:
judging whether the operation behavior is a target operation behavior;
and if the operation behavior is the target operation behavior, executing a step of determining that the operation behavior causes the change part of the DOM structure of the initial document object model.
In an alternative embodiment, the target operational behavior includes a user interaction operational behavior, an element scroll operational behavior, and a window change operational behavior.
In an alternative embodiment, the step of determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure comprises:
determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior;
comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior;
and associating the operation behaviors, the operation time and the change part to generate associated data.
In an optional embodiment, comparing the initial document object model DOM structure with the document object model DOM structure corresponding to the operation behavior to determine that the operation behavior causes a changed part of the initial document object model DOM structure includes:
serializing the initial Document Object Model (DOM) structure to generate an initial Abstract Syntax Tree (AST) corresponding to the initial DOM structure;
serializing a Document Object Model (DOM) structure corresponding to the operation behavior to generate an Abstract Syntax Tree (AST) corresponding to the DOM structure corresponding to the operation behavior;
determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior; the change part is a Document Object Model (DOM) change part or an Abstract Syntax Tree (AST) change part.
In an alternative embodiment, when the change part is an abstract syntax tree AST change part;
the step of determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior comprises the following steps:
determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
the step of playing back based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part comprises the following steps:
generating a Document Object Model (DOM) change part based on the AST change part;
generating a Document Object Model (DOM) structure corresponding to the operation behavior based on an initial DOM structure and the DOM changed part;
and playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
In a second aspect, an embodiment provides an apparatus for backtracking an abnormal monitoring behavior, which records an initial document object model DOM structure of a recording moment in advance; the device comprises:
the monitoring module is used for monitoring the operation behavior of a user;
a determining module for determining that the operational behavior results in a changed portion of the initial document object model, DOM, structure;
and the playback module is used for playing back based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part.
In an alternative embodiment, the determining module, when determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure, is configured to:
determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior;
comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior;
and associating the operation behaviors, the operation time and the change part to generate associated data.
In a third aspect, embodiments provide an electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement the method of any one of the preceding embodiments.
In a fourth aspect, embodiments provide a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the air conditioner remote control method according to any one of the preceding embodiments.
The method, the device, the electronic equipment and the computer-readable storage medium for backtracking the abnormal monitoring behaviors, provided by the embodiment of the invention, comprise the steps of firstly monitoring the operation behaviors of a user; determining that the operation behavior causes a changed part of an initial Document Object Model (DOM) structure; playback is performed based on the initial document object model DOM structure, operational behavior, and altered portions. Therefore, compared with the prior art, the technical scheme provided by the embodiment of the invention has the advantages that the backtracking method of the abnormal monitoring behavior is simpler, the problem of higher network overhead caused by the fact that the picture occupies too much network and system resources is solved, and the network overhead is reduced. In addition, when monitoring, the method can determine the abnormity or problem caused by the behavior of the user mode without inquiring the user, thereby realizing accurate recurrence of the abnormity or problem, accurately positioning the abnormity or problem and facilitating the solution of the abnormity or problem.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic flowchart illustrating a method for tracing back an abnormal monitoring behavior according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating another method for tracing exception monitoring behavior according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a third method for tracing back an abnormal monitoring behavior according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an apparatus for tracing back an abnormal monitoring behavior according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The backtracking of the current abnormal monitoring behavior is mainly realized by a canvs screenshot method, and the process is as follows: 1. collecting a Document Object Model (DOM) and storing the DOM in a queue; 2. drawing a Document Object Model (DOM) and a CSS into a Canvas; 3. the screenshot is collected, and the picture is generated to play and replay by frames, however, the method has the following defects: the method, the device and the electronic equipment for backtracking the abnormal monitoring behavior are simple to operate, network overhead is reduced, and the problems of high complexity and high network overhead in the prior art are solved.
For the convenience of understanding the embodiment, first, a detailed description is given to a detection method for performing hidden channel communication based on ICMP protocol disclosed in the embodiment of the present invention.
Example one
The embodiment of the invention provides a backtracking method for abnormal monitoring behaviors, which records an initial Document Object Model (DOM) structure (initial DOM structure for short) at the recording moment in advance; when recording is started, recording the overall DOM structure of an initial page (such as a web page), specifically, acquiring and recording the overall DOM structure of the page through document. Note that this is the only DOM record of a complete page at a time, after which only the portion of the operation that caused the change (hereinafter referred to as the changed portion) is recorded.
As shown in fig. 1, specifically, the method includes:
step S102, monitoring the operation behavior of a user;
step S104, determining a changed part of the DOM structure of the initial document object model caused by the operation behavior;
and step S106, performing playback based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part.
For step S102, the operation behavior of the user includes an operation of the user in the page and an operation of the user on the page, the operation of the user in the page may include a click operation (e.g., mouse click), a copy operation, a view operation, a scroll operation (e.g., mouse scroll operation, page scroll bar operation), and the like, and the operation of the user on the page may be, for example, zooming the page, zooming the window, and the like. The operation behavior carries a time stamp, and the operation time corresponding to the operation behavior can be determined through the time stamp.
In step S104, a DOM snapshot is generated based on a change in the user operation, and a changed portion is identified, where the changed portion may be a DOM changed portion or an AST changed portion.
In an alternative embodiment, the step S104 of determining that the operation action results in a changed part of the initial document object model DOM structure comprises the steps of:
1, determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior;
specifically, when a user operation behavior occurs, a DOM structure corresponding to the operation behavior is obtained, for example, the DOM structure corresponding to the operation behavior is obtained through document. And determining the operation time corresponding to the operation behavior according to the timestamp carried by the operation behavior.
It should be noted that the DOM structure corresponding to the operation behavior may be understood as a DOM structure after the operation behavior occurs, for example, a DOM structure after a user clicks a mouse (generally, a DOM structure of a page one frame after the operation behavior occurs). Of course, in other embodiments, the operation time may be determined before the step of playing back based on the initial document object model DOM structure, the operation behavior, and the changed part, for example, may be determined while monitoring the operation behavior of the user, and is not limited specifically herein.
2, comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior;
the alteration portion is determined here by comparing the difference between the two. The method only requires that the original initial DOM is recorded, and then the DOM that changes with each operation can be deduced back from the recorded changes (altered portions) and the original initial DOM.
In an optional embodiment, the step S104 may further include:
and 3, associating the operation behaviors and the operation time with the change part to generate associated data.
And 4, recording the associated data in the operation queue according to the time sequence so as to obtain the associated data from the operation queue during the playback.
And 5, storing the associated data or the operation queue to local or uploading periodically.
In an optional embodiment, the step 2 of comparing the initial document object model DOM structure with the document object model DOM structure corresponding to the operation behavior to determine that the operation behavior causes a changed part of the initial document object model DOM structure may be implemented by the following steps:
2.1 serializing the initial document object model DOM structure to generate an initial abstract syntax tree AST (initial AST for short) corresponding to the initial document object model DOM structure;
specifically, the initial abstract syntax tree AST may be formed by serializing the initial document object model DOM structure by HTMLparse.
In an alternative embodiment, this step 2.1 comprises the following sub-steps:
2.11, analyzing a starting label;
specifically, a label is started through label regular matching, the label name is analyzed, and an AST node maintenance label element stack is generated;
2.12, analyzing the label attribute;
specifically, attrs attributes of the labels are matched, and attribute key value pairs are circularly analyzed;
2.13, analyzing the end label;
specifically, matching the same type of labels in the label element stack, and updating the node hierarchical relationship after the same type of labels are taken out;
and 2.14, circularly processing the DOM structure of the initial document object model to generate the AST corresponding to the DOM structure.
2.2 serializing the DOM structure corresponding to the operation behavior to generate an abstract syntax tree AST corresponding to the DOM structure corresponding to the operation behavior;
in concrete implementation, the above steps 2.11-2.14 may be referred to obtain the abstract syntax tree AST corresponding to the document object model DOM structure corresponding to the operation behavior, which is not described again in this embodiment.
2.3, determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
the change part is a Document Object Model (DOM) change part (DOM change part for short) or an abstract syntax tree (AST change part for short).
Accordingly, this step 2.3 can be implemented in two ways:
the first method is as follows: when the change part is an abstract syntax tree AST change part;
in this case, step 2.3 comprises:
determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
correspondingly, step 3 associates the operation behavior, the operation time and the change part to generate associated data, and the associated data includes: and associating the operation behavior and the operation time with the AST changing part to generate associated data.
Correspondingly, the step S106 performs playback based on the initial document object model DOM structure, the operation behavior, and the changed part, and includes:
a generating a Document Object Model (DOM) changed part based on the AST changed part;
b, generating a Document Object Model (DOM) structure corresponding to the operation behavior based on the initial DOM structure and the DOM changed part;
c, playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
Here, each time a complete DOM is generated, it is rendered into a complete web page, and finally played back.
During specific implementation, firstly, acquiring recorded associated data from an operation queue, and putting the associated data into a playback queue according to a time sequence; and during playback, acquiring the associated data of the operation time from the playback queue at fixed time (at the operation time corresponding to the operation behavior), and processing the associated data of the operation time according to the steps a to c to realize playback and reproduction.
Note that the playback queue is continuously checked with a requestAnimationFrame during playback, and playback is taken out from the playback queue.
The second method comprises the following steps: when the change part is a DOM change part;
in this case, step 2.3 comprises:
(1) determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
(2) generating a DOM change portion based on the AST change portion;
correspondingly, step 3 associates the operation behavior, the operation time and the change part to generate associated data, and the associated data includes: and associating the operation behavior and the operation time with the DOM changed part to generate associated data.
Correspondingly, the step S106 performs playback based on the initial document object model DOM structure, the operation behavior, and the changed part, and includes:
m, generating a Document Object Model (DOM) structure corresponding to the operation behavior based on an initial DOM structure and the DOM changed part;
and N, playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
Here, each time a complete DOM is generated, it is rendered into a complete web page, and finally played back.
During specific implementation, firstly, acquiring recorded associated data from an operation queue, and putting the associated data into a playback queue according to a time sequence; and during playback, acquiring the associated data of the operation time from the playback queue at fixed time (at the operation time corresponding to the operation behavior), and executing the associated data of the operation time according to the step M and the step N to realize playback and reproduction.
Note that the playback queue is continuously checked with a requestAnimationFrame during playback, and playback is taken out from the playback queue.
According to the method for backtracking the abnormal monitoring behavior, the DOM structure of the initial document object model at the recording moment is recorded in advance; the method comprises the following steps: monitoring the operation behavior of a user; determining that the operation behavior causes a changed part of an initial Document Object Model (DOM) structure; and playing back the Document Object Model (DOM) based on the initial DOM structure, the operation behavior and the changed part. According to the method, the complete initial DOM structure when recording is started is recorded, the changed part caused by the operation behavior is determined and recorded based on the user operation behavior, the DOM structure corresponding to the operation behavior can be reversely deduced according to the initial DOM structure, the operation behavior and the changed part during playback, and the DOM structure corresponding to the deduced operation behavior is rendered and played back at the operation moment, so that compared with the prior art, the backtracking method of the abnormal monitoring behavior is simpler, the problem of high network overhead caused by the fact that excessive pictures occupy network and system resources is solved, and the network overhead is reduced. In addition, when monitoring, the method can determine the abnormity or problem caused by the behavior of the user mode without inquiring the user, thereby realizing accurate recurrence of the abnormity or problem, accurately positioning the abnormity or problem and facilitating the solution of the abnormity or problem.
Example two
As shown in fig. 2, another method for tracing an abnormal monitoring behavior is provided in the embodiments of the present application, in which an initial document object model DOM structure (initial DOM structure for short) at a recording time is recorded in advance. The method comprises the following steps:
step S202, monitoring the operation behavior of a user;
step S204, judging whether the operation behavior is a target operation behavior;
if the operation behavior is the target operation behavior, executing step S206, and if not, that is, the operation behavior is not the target operation behavior, executing step S202 to continue monitoring.
Step S206, determining that the operation behavior causes the changed part of the DOM structure of the initial document object model;
in step S208, playback is performed based on the initial document object model DOM structure, the operation behavior, and the changed portion.
In an alternative embodiment, the target operation behavior includes operation behaviors that are easy to cause DOM changes or generate exceptions, such as user interaction operation behavior, element scrolling operation behavior, and window changing operation behavior.
The user interaction operation behavior may be, for example, a user login operation, a registration operation, a mouse click operation, and the like.
The element may be a mouse, a scroll bar, etc., and the element scroll operation behavior includes a mouse scroll operation, an element scroll operation, etc.
The window change operation behavior includes, but is not limited to, window enlargement, window reduction, window hiding, window closing, and the like.
According to the method for backtracking the abnormal monitoring behavior, whether the operation behavior is the target operation behavior or not is judged, namely, the user operation which possibly causes the abnormality or the problem is monitored, so that the method is beneficial to further reducing the network resource overhead.
EXAMPLE III
As shown in fig. 3, the method comprises the steps of:
step S302, recording an initial DOM structure of the front end page;
specifically, the overall initial DOM structure of the page is obtained through document.
Step S304, forming AST through an HTML (hypertext markup language) parse serialization DOM structure;
the DOM structure here may be an initial DOM structure, a DOM structure after a user operation, or a DOM modification portion. That is, step S304 applies to all DOM structures.
Specifically, the step S304 includes the following steps:
b1, analysis start tag: starting a label through label regular matching, analyzing a label name, and generating an AST node maintenance label element stack;
b2, resolving the label attribute: matching attrs attributes of the labels, and circularly analyzing attribute key value pairs;
b3, analysis end tag: matching the same type labels in the label element stack, and updating the node hierarchical relation after the same type labels are taken out;
b4, circularly processing the DOM structure to generate the corresponding AST.
Step S306, comparing and recording DOM changes based on specific operations of a user;
the specific operation herein may refer to a target operation behavior.
This step S306 may be implemented by:
c1, recording key changes of specific operations (DOM changes, user interactions, element scrolling, window changes);
c2, acquiring a DOM structure after a specific operation;
acquiring a DOM structure after operation by document element, and converting the AST generated corresponding to the DOM structure after operation according to the step S304 into an AST so as to perform Diff with the initial AST, that is, the Diff algorithm is directed to the AST;
it should be noted that the DOM and the AST can be converted to each other.
And C3, acquiring the changed part based on the Diff algorithm, and storing the changed part and the specific operation (including the operation time) correspondingly (local storage and timed report).
The modification part may be an AST modification part or a DOM modification part;
note that if an AST change portion is recorded, the AST change portion needs to be converted into a DOM change portion upon playback; if the DOM change is recorded directly (conversion is achieved in this step), the step of converting the AST change into a DOM change is therefore omitted on playback.
And step S308, when the playback is needed, taking out the corresponding data operation queue, and reproducing the operation to realize the playback.
Specifically, here, the AST change structure is recorded, and the step S308 includes:
d1, generating a DOM structure by rendering the AST again in the iframe;
d2, according to the operation in recording, arranging according to time sequence, and putting into playback reproduction queue (playback queue).
D3, continuously checking the recurrence queue by using the requestAnamationFrame, and taking the recurrence out of the queue.
In other embodiments, step S308 may be implemented by:
firstly, acquiring records, then putting the records into a playback queue according to time sequence, operating the playback queue at regular time, generating the AST into a DOM structure corresponding to a specific operation and reproducing the DOM structure.
The method for tracing the abnormal monitoring behavior is a method for solving the problem of sporadic product and acquiring an operation path for reappearing. The DOM structure is then reconstructed only according to the recorded operation time, thereby enabling playback reproduction. The method mainly aims to monitor the abnormity, reduce the realization complexity and the network overhead of the playback, simultaneously accurately play back the problems caused by the user behaviors, accurately position and facilitate the solution of the problems.
Example four
Based on the same inventive concept, the embodiment of the present application further provides a multi-application access right control device corresponding to the multi-application access right control method, and as the principle of solving the problem of the device in the embodiment of the present application is similar to that of the above-mentioned mobile state control method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are omitted.
As shown in fig. 4, an embodiment of the present invention provides an apparatus for tracing back an abnormal monitoring behavior, which records a DOM structure of an initial document object model at a recording time in advance; the device comprises: a monitoring module 401, a determination module 402, a playback module 403.
The monitoring module 401 is configured to monitor an operation behavior of a user;
a determination module 402 for determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure;
the playback module 403 is configured to perform playback based on the initial document object model DOM structure, the operation behavior, and the changed part.
In an alternative embodiment, the apparatus further comprises:
the judging module is used for judging whether the operation behavior is a target operation behavior; and if the operation behavior is the target operation behavior, executing a step of determining that the operation behavior causes the change part of the DOM structure of the initial document object model.
In an alternative embodiment, the target operation behavior includes a user interaction operation behavior, an element scroll operation behavior, and a window change operation behavior.
In an alternative embodiment, the determining module 402, when determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure, is configured to: determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior; comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior; and associating the operation behaviors, the operation time and the change part to generate associated data.
In an alternative embodiment, the determining module 402, when comparing the initial document object model DOM structure with the document object model DOM structure corresponding to the operation behavior and determining that the operation behavior causes a changed part of the initial document object model DOM structure, is configured to: serializing the initial Document Object Model (DOM) structure to generate an initial Abstract Syntax Tree (AST) corresponding to the initial DOM structure; serializing a Document Object Model (DOM) structure corresponding to the operation behavior to generate an Abstract Syntax Tree (AST) corresponding to the DOM structure corresponding to the operation behavior; determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior; the change part is a Document Object Model (DOM) change part or an Abstract Syntax Tree (AST) change part.
In an alternative embodiment, the change part is an abstract syntax tree AST change part;
when determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the document object model DOM structure corresponding to the operation behavior, the determining module 402 is configured to: determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
the playback module 403, when playing back based on the initial document object model DOM structure, the operation behavior, and the altered portion, is configured to: generating a Document Object Model (DOM) change part based on the AST change part; generating a Document Object Model (DOM) structure corresponding to the operation behavior based on an initial DOM structure and the DOM changed part; and playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
The device for tracing the abnormal monitoring behavior provided by the embodiment of the application has the same technical characteristics as the method for tracing the abnormal monitoring behavior provided by the embodiment, so that the same technical problems can be solved, and the same technical effect can be achieved.
Referring to fig. 5, an embodiment of the present invention further provides an electronic device 100, which records an initial document object model DOM structure of a recording time in advance, and includes:
a processor 41, a memory 42, and a bus 43; the memory 42 is used for storing execution instructions and includes a memory 421 and an external memory 422; the memory 421 is also referred to as an internal memory, and is used for temporarily storing the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk, the processor 41 exchanges data with the external memory 422 through the memory 421, and when the electronic device 400 operates, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions: monitoring the operation behavior of a user; determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure; and playing back the Document Object Model (DOM) based on the initial DOM structure, the operation behavior and the changed part.
Optionally, the instructions executed by the processor 41 further include: judging whether the operation behavior is a target operation behavior; and if the operation behavior is the target operation behavior, executing a step of determining that the operation behavior causes the change part of the DOM structure of the initial document object model.
Optionally, the processor 41 executes instructions in which the target operation behavior includes a user interaction operation behavior, an element scroll operation behavior, and a window change operation behavior.
Optionally, the step of determining, in instructions executed by the processor 41, that the operational behavior results in an altered portion of the initial document object model DOM structure comprises: determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior; comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior; and associating the operation behaviors, the operation time and the change part to generate associated data.
Optionally, the step of comparing, by the processor 41, the initial document object model DOM structure with the document object model DOM structure corresponding to the operation behavior to determine that the operation behavior causes a changed part of the initial document object model DOM structure includes: serializing the initial Document Object Model (DOM) structure to generate an initial Abstract Syntax Tree (AST) corresponding to the initial DOM structure; serializing a Document Object Model (DOM) structure corresponding to the operation behavior to generate an Abstract Syntax Tree (AST) corresponding to the DOM structure corresponding to the operation behavior; determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior; the change part is a Document Object Model (DOM) change part or an Abstract Syntax Tree (AST) change part.
Optionally, in the instruction executed by the processor 41, when the change part is an abstract syntax tree AST change part; the step of determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior comprises the following steps: determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
the step of playing back based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part comprises the following steps: generating a Document Object Model (DOM) change part based on the AST change part; generating a Document Object Model (DOM) structure corresponding to the operation behavior based on an initial DOM structure and the DOM changed part; and playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling access rights of multiple applications provided in the above embodiment are executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A backtracking method for abnormal monitoring behaviors is characterized in that an initial Document Object Model (DOM) structure at the recording moment is recorded in advance; the method comprises the following steps:
monitoring the operation behavior of a user;
determining that the operational behavior results in an altered portion of the initial document object model, DOM, structure;
and playing back the Document Object Model (DOM) based on the initial DOM structure, the operation behavior and the changed part.
2. The method of claim 1, wherein after the step of monitoring the operational behavior of the user, the method further comprises:
judging whether the operation behavior is a target operation behavior;
and if the operation behavior is the target operation behavior, executing a step of determining that the operation behavior causes the change part of the DOM structure of the initial document object model.
3. The method of claim 2, wherein the target operational behavior comprises user interaction operational behavior, element scrolling operational behavior, and window change operational behavior.
4. The method according to claim 1, wherein the step of determining that said operational behavior results in an altered portion of said initial document object model, DOM, structure comprises:
determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior;
comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior;
and associating the operation behaviors, the operation time and the change part to generate associated data.
5. The method of claim 4, wherein comparing an initial Document Object Model (DOM) structure to a Document Object Model (DOM) structure corresponding to the operational behavior to determine that the operational behavior results in an altered portion of the initial Document Object Model (DOM) structure comprises:
serializing the initial Document Object Model (DOM) structure to generate an initial Abstract Syntax Tree (AST) corresponding to the initial DOM structure;
serializing a Document Object Model (DOM) structure corresponding to the operation behavior to generate an Abstract Syntax Tree (AST) corresponding to the DOM structure corresponding to the operation behavior;
determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior; the change part is a Document Object Model (DOM) change part or an Abstract Syntax Tree (AST) change part.
6. The method of claim 5, wherein the change portion is an abstract syntax tree AST change portion;
the step of determining the changed part based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior comprises the following steps:
determining to obtain an abstract syntax tree AST change part by applying a Diff algorithm based on the initial abstract syntax tree AST and the abstract syntax tree AST corresponding to the Document Object Model (DOM) structure corresponding to the operation behavior;
the step of playing back based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part comprises the following steps:
generating a Document Object Model (DOM) change part based on the AST change part;
generating a Document Object Model (DOM) structure corresponding to the operation behavior based on an initial DOM structure and the DOM changed part;
and playing back the Document Object Model (DOM) structure corresponding to the operation behavior at the operation moment.
7. A device for backtracking abnormal monitoring behaviors is characterized in that an initial Document Object Model (DOM) structure at the recording moment is recorded in advance; the device comprises:
the monitoring module is used for monitoring the operation behavior of a user;
a determining module for determining that the operational behavior results in a changed portion of the initial document object model, DOM, structure;
and the playback module is used for playing back based on the initial Document Object Model (DOM) structure, the operation behavior and the changed part.
8. The apparatus according to claim 7, wherein said determining module, when determining that said operational behavior results in an altered portion of said initial document object model, DOM, structure, is configured to:
determining a Document Object Model (DOM) structure and operation time corresponding to the operation behavior;
comparing an initial Document Object Model (DOM) structure with a DOM structure corresponding to the operation behavior to determine a changed part of the initial DOM structure caused by the operation behavior;
and associating the operation behaviors, the operation time and the change part to generate associated data.
9. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement the method of any one of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for anomaly monitoring behavior backtracking according to any one of claims 1-6.
CN201911289534.XA 2019-12-13 2019-12-13 Method and device for backtracking abnormal monitoring behaviors and electronic equipment Pending CN111078519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911289534.XA CN111078519A (en) 2019-12-13 2019-12-13 Method and device for backtracking abnormal monitoring behaviors and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911289534.XA CN111078519A (en) 2019-12-13 2019-12-13 Method and device for backtracking abnormal monitoring behaviors and electronic equipment

Publications (1)

Publication Number Publication Date
CN111078519A true CN111078519A (en) 2020-04-28

Family

ID=70314625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911289534.XA Pending CN111078519A (en) 2019-12-13 2019-12-13 Method and device for backtracking abnormal monitoring behaviors and electronic equipment

Country Status (1)

Country Link
CN (1) CN111078519A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818123A (en) * 2020-05-28 2020-10-23 中国平安财产保险股份有限公司 Network front-end remote playback method, device, equipment and storage medium
CN112256524A (en) * 2020-09-27 2021-01-22 湖南映客互娱网络信息有限公司 Web front-end monitoring method and system based on screen recording playback
CN112527643A (en) * 2020-12-11 2021-03-19 杭州安恒信息技术股份有限公司 Front-end error detection method and device, electronic equipment and readable storage medium
CN112527748A (en) * 2020-12-24 2021-03-19 北京百度网讯科技有限公司 Method, device, equipment and storage medium for analyzing user operation behaviors
CN113609516A (en) * 2021-10-11 2021-11-05 北京德风新征程科技有限公司 Information generation method and device based on abnormal user, electronic equipment and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693237A (en) * 2011-03-24 2012-09-26 中国科学院声学研究所 Webpage content adaptation and encapsulation system and method
CN104598232A (en) * 2015-01-12 2015-05-06 北京大学 Equipment-crossing capturing-replaying method of Web application
CN106371946A (en) * 2016-09-13 2017-02-01 乐视控股(北京)有限公司 Browser exception recovery processing method and device
US20170323026A1 (en) * 2016-05-03 2017-11-09 International Business Machines Corporation Patching Base Document Object Model (DOM) with DOM-Differentials to Generate High Fidelity Replay of Webpage User Interactions
US20170357624A1 (en) * 2016-06-10 2017-12-14 International Business Machines Corporation Generating a Document Object Model (DOM) Differential
US20180060446A1 (en) * 2016-08-31 2018-03-01 Entit Software Llc Document object model transaction crawler
CN108572819A (en) * 2017-12-21 2018-09-25 北京金山云网络技术有限公司 Method for updating pages, device, terminal and computer readable storage medium
CN109739500A (en) * 2018-12-14 2019-05-10 中国四维测绘技术有限公司 A kind of browser front end under B/S framework renders methods of exhibiting
CN110309461A (en) * 2019-07-04 2019-10-08 郑州悉知信息科技股份有限公司 Webpage representation method and apparatus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693237A (en) * 2011-03-24 2012-09-26 中国科学院声学研究所 Webpage content adaptation and encapsulation system and method
CN104598232A (en) * 2015-01-12 2015-05-06 北京大学 Equipment-crossing capturing-replaying method of Web application
US20170323026A1 (en) * 2016-05-03 2017-11-09 International Business Machines Corporation Patching Base Document Object Model (DOM) with DOM-Differentials to Generate High Fidelity Replay of Webpage User Interactions
US20170357624A1 (en) * 2016-06-10 2017-12-14 International Business Machines Corporation Generating a Document Object Model (DOM) Differential
US20180060446A1 (en) * 2016-08-31 2018-03-01 Entit Software Llc Document object model transaction crawler
CN106371946A (en) * 2016-09-13 2017-02-01 乐视控股(北京)有限公司 Browser exception recovery processing method and device
CN108572819A (en) * 2017-12-21 2018-09-25 北京金山云网络技术有限公司 Method for updating pages, device, terminal and computer readable storage medium
CN109739500A (en) * 2018-12-14 2019-05-10 中国四维测绘技术有限公司 A kind of browser front end under B/S framework renders methods of exhibiting
CN110309461A (en) * 2019-07-04 2019-10-08 郑州悉知信息科技股份有限公司 Webpage representation method and apparatus

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818123A (en) * 2020-05-28 2020-10-23 中国平安财产保险股份有限公司 Network front-end remote playback method, device, equipment and storage medium
CN111818123B (en) * 2020-05-28 2023-10-20 中国平安财产保险股份有限公司 Network front-end remote playback method, device, equipment and storage medium
CN112256524A (en) * 2020-09-27 2021-01-22 湖南映客互娱网络信息有限公司 Web front-end monitoring method and system based on screen recording playback
CN112527643A (en) * 2020-12-11 2021-03-19 杭州安恒信息技术股份有限公司 Front-end error detection method and device, electronic equipment and readable storage medium
CN112527748A (en) * 2020-12-24 2021-03-19 北京百度网讯科技有限公司 Method, device, equipment and storage medium for analyzing user operation behaviors
CN112527748B (en) * 2020-12-24 2024-04-09 北京百度网讯科技有限公司 Method, device, equipment and storage medium for analyzing user operation behavior
CN113609516A (en) * 2021-10-11 2021-11-05 北京德风新征程科技有限公司 Information generation method and device based on abnormal user, electronic equipment and medium
CN113609516B (en) * 2021-10-11 2022-05-31 北京德风新征程科技有限公司 Information generation method and device based on abnormal user, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN111078519A (en) Method and device for backtracking abnormal monitoring behaviors and electronic equipment
CN110928772B (en) Test method and device
CN111818123B (en) Network front-end remote playback method, device, equipment and storage medium
CN105144117B (en) To the automatic correlation analysis method of allocating stack and context data
US20150363300A1 (en) Generating software test script from video
KR20110107363A (en) Method for server-side logging of client browser state through markup language
CN107085549B (en) Method and device for generating fault information
CN111898055A (en) Screen recording and playback method for browser webpage
CN110837474A (en) Script recording method, device, terminal and storage medium
CN112148571A (en) Method and device for recording and playing back webpage operation process
CN112685672B (en) Page session behavior trace backtracking method and device and electronic equipment
CN114692049A (en) Browser-based screen recording method and device, electronic equipment and storage medium
US10649634B2 (en) Indexing and annotating a usability test recording
CN113448845A (en) UI automation test method and system
CN113987393A (en) Web page operation recorder, system, device and method
CN105468511A (en) Web page script error positioning method and apparatus
WO2021142771A1 (en) Service ticket generation method, apparatus and system
JP4686559B2 (en) Communication monitoring recording / reproducing apparatus and communication monitoring recording / reproducing system
WO2016131308A1 (en) Control method and apparatus for generating web interface
CN113485909A (en) Test method, test device, computing device, and medium
EP2599042A1 (en) Systems and methods of rapid business discovery and transformation of business processes
CN111552872A (en) Method and system for restoring user behavior, electronic device and storage medium
CN113051095B (en) Method and device for reproducing operation errors of client, electronic equipment and storage medium
CN115292636A (en) H5 page recording method, device and equipment and storage medium
CN112699279B (en) Method, device, equipment and storage medium for automatically processing components

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