CN113342629B - Operation track restoration method and device, computer equipment and storage medium - Google Patents
Operation track restoration method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113342629B CN113342629B CN202110638750.1A CN202110638750A CN113342629B CN 113342629 B CN113342629 B CN 113342629B CN 202110638750 A CN202110638750 A CN 202110638750A CN 113342629 B CN113342629 B CN 113342629B
- Authority
- CN
- China
- Prior art keywords
- operation behavior
- application
- sub
- target
- log
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3457—Performance evaluation by simulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3438—Recording 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
The application relates to an operation track restoration method and device, computer equipment and a storage medium. The method comprises the following steps: sequentially determining current operation behavior logs from an operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence; acquiring a sub-application code corresponding to the current operation behavior log through an automation script, and calling an element acquisition function from a preset function library provided by a sub-application automation toolkit to acquire a target element acted by a target operation behavior from the sub-application code; calling a corresponding execution function from a preset function library according to the event type in the current operation behavior log; and simulating and executing target operation behaviors on the target elements based on the execution function so as to restore and generate corresponding interfaces. By adopting the method, the efficiency of operation track reduction can be improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to an operation trajectory restoration method and apparatus, a computer device, and a storage medium.
Background
With the rapid development of scientific technology, a great deal of advanced technology is emerging continuously. The small program is a new technology and product form. A so-called applet (Mini program) is an application that can be used without downloading and installation. The user can use the small program to perform corresponding operation so as to obtain corresponding service.
In some cases, it is desirable to determine the operational behavior of a user when using an applet. For example, when a user has a problem in operating an applet, it is necessary to determine the operation behavior of the user using the applet to locate the operation error of the user. For another example, if the user is suspicious of the past operation, it is also necessary to determine the operation behavior of the user when using the applet for the user to confirm.
At present, the operation behaviors of users when using applets all need developers to manually search and search from the text log information of the applets. Because the text log information of the applet comprises a plurality of information without logic, such as a front end, a background, a gateway and the like, which are very large, logical and complicated, the task of manually searching the information related to the required operation behavior is very heavy, and the efficiency is very low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an operation trajectory restoration method, an operation trajectory restoration apparatus, a computer device, and a storage medium, which can improve efficiency.
A method of operation trajectory restoration, the method comprising:
sequentially determining current operation behavior logs from an operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence;
acquiring a sub-application code corresponding to the current operation behavior log through the automation script, and calling an element acquisition function from a preset function library provided by a sub-application automation toolkit to acquire a target element acted by a target operation behavior from the sub-application code; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element in the document object model on which the target operation behavior acts;
calling a corresponding execution function from the preset function library according to the event type in the current operation behavior log;
simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
An operation trajectory restoration device, the device comprising:
the acquisition module is used for sequentially determining the current operation behavior logs from the operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence;
the calling module is used for acquiring the sub-application codes corresponding to the current operation behavior logs through the automation script, calling an element acquisition function from a preset function library provided by a sub-application automation toolkit, and acquiring target elements acted by target operation behaviors from the sub-application codes; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element in the document object model on which the target operation behavior acts;
the calling module is also used for calling a corresponding execution function from the preset function library according to the event type in the current operation behavior log;
the simulation restoration module is used for simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the operation trajectory restoration method described in the embodiments of the present application when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the operation trajectory restoration method described in the embodiments of the present application.
According to the operation track restoring method, the operation track restoring device, the computer equipment and the storage medium, the operation behavior log array is obtained through the automatic script, the current operation behavior log is sequentially determined from the operation behavior log array, and the sub application code corresponding to the current operation behavior log is obtained through the automatic script. Acquiring a target element acted by a target operation behavior from a sub-application code by using an element acquisition function provided by a sub-application automation toolkit, and calling a corresponding execution function from the preset function library according to an event type in the current operation behavior log; and simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface. Because the operation behavior log array can be identified by the automatic script, the operation behavior log array only contains log information which is arranged in sequence and is relevant to the operation behavior after screening and formatting a large amount of complicated text log information of sub-applications, and unnecessary data interference is greatly reduced. And restoring to generate a corresponding interface when each operation behavior is simulated and executed, and restoring the generated continuous interface for each operation behavior log in sequence to represent the operation track for the target sub-application. Equivalently, the operation behavior log array only related to the operation behavior is automatically restored based on the automatic script code, the sub-application automation toolkit and the operation behavior log array, the whole operation track of the user in use can be quickly and intuitively restored without complicated and large amount of manual query operation of the user, and the efficiency is greatly improved.
Drawings
FIG. 1 is a diagram of an application environment for a method of operation trajectory restoration in one embodiment;
FIG. 2 is a flowchart illustrating a method for operation trajectory reduction according to an embodiment;
FIG. 3 is a diagram of source log data in one embodiment;
FIG. 4 is a diagram of an operation behavior log array in one embodiment;
FIG. 5 is a schematic diagram of a promoter application developer tool in one embodiment;
FIG. 6 is a diagram of a simulated sub-application page in one embodiment;
FIG. 7 is a schematic diagram of a trajectory reduction method of operation in one embodiment;
FIG. 8 is a block diagram showing the structure of an operation trajectory restoring apparatus according to an embodiment;
FIG. 9 is a block diagram showing the construction of an operation trajectory restoring apparatus according to another embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, the operation trajectory restoration method provided by the present application may be applied to an application environment as shown in fig. 1. The terminal 110 and the server 120 can communicate with each other through a network. The terminal 110 has an automation script installed therein.
The terminal 110 may sequentially determine the current operation behavior log from the operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence. The terminal 110 may obtain, through the automation script, a sub-application code corresponding to the current operation behavior log, and call an element obtaining function from a preset function library provided by a sub-application automation toolkit, so as to obtain, from the sub-application code, a target element on which a target operation behavior acts; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element in the document object model on which the target operation behavior acts. The terminal 110 may call a corresponding execution function from the preset function library according to the event type in the current operation behavior log; simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
It is to be understood that the terminal in the embodiments of the present application may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, an operation trajectory restoration method is provided, which may be executed by a terminal or may be implemented through interaction between the terminal and a server. Taking the application of the method to the terminal in fig. 1 as an example, the method includes the following steps:
The automatic script is a script code which can automatically execute a task after running.
The operation behavior log array comprises operation behavior logs arranged according to the behavior occurrence sequence. And the operation behavior log is used for recording the operation behavior aiming at the target sub-application. It can be understood that the operation behavior log includes information related to the operation behavior, and the recording of the operation behavior is realized by recording the information related to the operation behavior. The information related to the operation behavior is information related to the operation behavior. It is to be appreciated that the format of each operational behavior log in the operational behavior log array is a format recognizable by the automation script.
In one embodiment, the information related to the operation behavior may include information related to the operation behavior, such as at least one of an event type to which the operation behavior belongs, a sub-application page address corresponding to the operation behavior, an identifier of a target element, input data, and scroll data. It is understood that the identification of the target element may be the name of the target element or a character for uniquely representing the target element, etc.
And the target sub-application is a sub-application needing to restore the operation track. The child application is an application program that can be implemented in an environment provided by the parent application. The parent application of the target child application is a native application program bearing the target child application, and provides an environment for realizing the target child application. A native application is an application that can run directly on an operating system.
It should be noted that the target sub-application may be any type of sub-application in any field, and is not limited to a specific sub-application. For example, the target sub-application may be a sub-application related to insurance business, a sub-application related to e-commerce, or a sub-application providing public policy service.
In one embodiment, the server may generate an operation behavior log array in advance according to the operation behavior log for the target sub-application. The terminal can run the automation script and obtain the operation behavior log array from the server through the automation script.
In another embodiment, the terminal may also generate an operation behavior log array locally at the terminal according to the operation behavior log for the target sub-application, and then obtain the operation behavior log array locally generated at the terminal by running the automation script.
In one embodiment, the automation script may be written using a JavaScript language or Python language. The present application does not limit the programming language of the automation script.
Specifically, the terminal may sequentially determine current operation behavior logs from the operation behavior log array through the automation script, and sequentially perform steps 204 to 208 for each current operation behavior log.
For example, if the operation behavior log array includes 3 operation behavior logs, the 1 st operation behavior log may be obtained as the current operation behavior log in sequence, and the execution steps 204 to 208 are executed for the 1 st operation behavior log, so as to simulate the operation behavior recorded by the 1 st operation behavior log, and restore the interface when the operation behavior recorded by the 1 st operation behavior log is executed. And then, selecting the 2 nd operation behavior log as the current operation behavior log in sequence, continuing to execute the steps 204-208 aiming at the new current operation behavior log, and so on, and correspondingly processing each operation behavior log in the operation behavior log array in sequence.
And 204, acquiring a sub-application code corresponding to the current operation behavior log through the automation script, and calling an element acquisition function from a preset function library provided by the sub-application automation toolkit to acquire a target element acted by the target operation behavior from the sub-application code.
The target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log. And the target element is an element in the document object model and acted on by the target operation behavior. The sub-application code corresponding to the current operation behavior log is the code of the sub-application page on which the operation behavior recorded by the current operation behavior log acts, that is, the code of the sub-application page on which the target operation behavior acts.
The child application automation toolkit (miniprogam-automation) is provided and can be a toolkit for operating a child application developer tool and a parent application in a real machine through NodeJS. The preset function library is a function library preset by the sub-application automation toolkit for realizing the automation operation of the sub-application. It is understood that the preset function library is a general function library preset for the sub-application, and can support the automation operation of any sub-application, but is not limited to support only the automation operation for the target sub-application.
The sub-application automation kit can provide some operation execution capabilities based on a preset function library, for example, operation execution capabilities of controlling the sub-application to jump to a specified page, obtaining sub-application page data, obtaining a sub-application page element state, triggering a sub-application element binding event, injecting a code segment into a logic layer (ApService), calling any interface on a parent application object and the like can be provided, so that after a function in the function library is called by an automation script, a sub-application developer tool and a parent application in a real machine can be controlled to simulate and execute corresponding operation behaviors aiming at a target sub-application. It can be understood that it provides the developer with the ability to manipulate the sub-application through external scripts, and the working principle is similar to the automation tools of web end, such as the automation tools of selenium, puppeteer, etc., except that the control object is changed into the sub-application by the browser. The automation script is based on the capability provided by the sub-application automation toolkit, and the operation track reduction processing of the target sub-application is realized.
In addition, an element acquisition function is also provided in the preset function library of the sub-application automation toolkit, and is used for acquiring an element (namely, a DOM element, where DOM is a document object model) in the document object model corresponding to the sub-application code. It can be understood that, in general, since the sub-application is limited, the element in the document object model corresponding to the sub-application page, that is, the DOM element of the sub-application page, cannot be acquired. However, the child application automation toolkit is officially provided by the parent application, and the preset function library provided by the child application automation toolkit contains a function for acquiring DOM elements of the child application page, that is, an element acquisition function.
And step 206, calling a corresponding execution function from a preset function library according to the event type in the current operation behavior log.
An event is a thing or an operational behavior, and thus, the event type is the type of operational behavior. Since the operation behavior log is used to record the operation behavior for the target sub-application, the operation behavior log includes an event type to which the recorded operation behavior belongs. For example, the operation behavior log records the operation behavior of clicking on the element a in the target sub-application page, and then the operation behavior log includes the click event, which is the event type to which the operation behavior belongs.
In one embodiment, the event type may include at least one of an entry event of the sub-application, a page jump event, a click event, an input event, a page scroll event, a slide event, a resource transfer event, a pop-up event, a share event, and an exit event of the sub-application. It is understood that the event type may be any event type triggered by the target sub-application, and is not exhaustive.
It will be appreciated that each event type has a corresponding execution function. The execution function corresponding to the event type is a function for realizing the operation behavior or action corresponding to the event type. The terminal can call an execution function for realizing the operation behavior or action corresponding to the event type from a preset function library of the sub-application automation toolkit through the automation script according to the event type in the current operation behavior log.
For example, if the event type is an input event, an input function, element.
In an embodiment, for each current operation behavior log, the terminal may extract an event type to which an operation behavior recorded in the current operation behavior log belongs from an event type field in the current operation behavior log, and call an execution function corresponding to the event type from a preset function library.
And step 208, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
It can be understood that the generated continuous interface is restored for each operation behavior log in turn, and is used for characterizing the operation track for the target sub-application.
Specifically, the terminal may simulate and execute the target operation behavior on the target element based on the called execution function and the related information of the operation behavior in the current operation behavior log, so as to restore and generate a corresponding interface.
For example, for an input event, the terminal may call an element input (value) function, and input data value = "123" recorded in the current operation behavior log, and simulate an input operation behavior of performing input "123" on a target element for input data.
It can be understood that, in the process of simulating and executing the operation behavior recorded by each operation behavior log, there is a corresponding interface performance, and the automation script sequentially executes the above steps for each current operation behavior log, so that the corresponding interface can be sequentially restored and displayed, and the whole operation track for the target sub-application can be completely and consistently represented.
According to the operation track restoration method, the operation behavior log array is obtained through the automation script, the current operation behavior log is sequentially determined from the operation behavior log array, and the sub-application code corresponding to the current operation behavior log is obtained through the automation script. Acquiring a target element acted by a target operation behavior from a sub-application code by using an element acquisition function provided by a sub-application automation toolkit, and calling a corresponding execution function from the preset function library according to an event type in the current operation behavior log; and simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface. Because the operation behavior log array can be identified by the automatic script, the operation behavior log array only contains log information which is arranged in sequence and is relevant to the operation behavior after a large amount of complicated text log information of the sub-application is screened and formatted, and unnecessary data interference is greatly reduced. And restoring to generate a corresponding interface when each operation behavior is simulated and executed, and restoring the generated continuous interface for each operation behavior log in sequence to represent the operation track for the target sub-application. Equivalently, the operation behavior log array only related to the operation behavior is automatically restored based on the automatic script code, the sub-application automation toolkit and the operation behavior log array, the whole operation track of the user in use can be quickly and intuitively restored without complicated and large amount of manual query operation of the user, and the efficiency is greatly improved.
In addition, the interface is simulated and restored by calling the execution function through the automatic script code, and the interface corresponding to each operation behavior log can be continuously and completely restored, so that the whole operation track can be completely restored without omission. Compared with the mode that the screenshots are spliced into the video (namely, the screenshot software is called to perform screenshot after the text information is restored into the static page, and then one picture of the screenshot is spliced into the video), the operation track restored by the scheme of the application is more accurate and fine.
Then, because the sub-application automation toolkit provides the element acquisition function, the target element can be acquired from the sub-application code, and the problem that the DOM element of the sub-application cannot be directly acquired in the past is solved, so that the target operation behavior can be directly simulated and executed aiming at the target element, the actual situation of the operation behavior is closer to the actual situation, the waste of resources such as redundant screenshot operation and the like is avoided, and the restoration of the operation track is accurately and conveniently realized.
Moreover, the continuous restoration of the interface corresponding to each operation behavior log is equivalent to the dynamic reproduction of the whole process when the user uses the sub-application, and the process is very visual and accurate like recording and playing. When the user suspects the past operation, the interface which can intuitively and accurately restore the whole operation track can be provided for the user as the evidence, the information quantity and effect expressed by the evidence are greatly improved, and the confidence level is improved.
In one embodiment, step 206 includes: if the event type in the current operation behavior log is a first event type, calling a corresponding native execution function from the preset function library, and acquiring interface information of a target parent application interface generated in advance in a simulation mode from the child application automation toolkit; in this embodiment, step 208 includes: and simulating and executing the target operation behavior on the target element based on the native execution function, and restoring the target parent application interface according to the interface information after the simulation execution is finished.
It can be understood that, when the target sub-application is operated, sometimes not only the interface change of the target sub-application itself is limited, but also the parent application may be involved in generating the native behavior in some cases, so that if it is desired to completely restore the entire operation track of the target sub-application, it is also necessary to restore the interface when the parent application generates the native behavior, but since the sub-application has no control capability for the parent application, the conventional method cannot restore the interface of the native behavior of the parent application involved, for example, a scheme of screenshot on a static page restored by text information cannot restore the interface of the native behavior of the parent application involved. The scheme of this application just provides an improvement scheme.
The first event type is an event type used for triggering the generation of the native behavior of the parent application. The target parent application interface is an interface displayed by the parent application when the native behavior of the parent application is triggered and generated. A native execution function is an execution function that triggers the generation of native behavior of the parent application upon execution.
In one embodiment, the first event type may include at least one of an event of jumping to the parent application, an event of requesting authorization of the parent application, an event of calling the parent application to provide a map, an event of calling the parent application to play a video, and the like. The event jumping to the parent application (i.e., the event jumping between the child application and the parent application) may include at least one of an event sharing information to the parent application, an event triggering the jump to the parent application through a page, and the like. For example, an event that shares content from the WeChat applet to the WeChat friend circle belongs to an event that shares information to the parent application.
Specifically, if the event type in the current operation behavior log is the first event type, it indicates that the operation behavior to be simulated, which is recorded in the current operation behavior log, triggers generation of the native behavior of the parent application, so that the terminal may call a corresponding native execution function from a preset function library through an automation script, and obtain interface information of a target parent application interface, which is generated by simulation in advance, from the child application automation toolkit.
It can be understood that, because the child application cannot control the execution operation of the parent application, the interface restoration cannot be performed by controlling the parent application to specifically execute the corresponding native behavior, but because the child application automation toolkit is used in the present application, because the child application automation toolkit is provided by the parent application official for the child application, the child application automation toolkit has a capability to rewrite some native execution functions of the parent application, and therefore, the terminal can rewrite some native execution functions of the parent application to the child application automation toolkit by using the capability of the child application automation toolkit, so as to call the interface restoration. In addition, the terminal can also pre-write the interface expression of the parent application when executing various native behaviors and store the interface expression into the child application automation toolkit. For example, for an event requesting authorization of a parent application, a native authorization function corresponding to the execution of the event may be rewritten to a child application automation toolkit in advance, and an authorization popup and popup disappearing interface (i.e., interface performance when the parent application is authorized) simulating the parent application may be written in advance.
It can be understood that when the to-be-automated script performs interface restoration based on the operation behavior log, a corresponding native execution function is automatically called from the child application automation toolkit, the target operation behavior is simulated and executed on the target element based on the native execution function, and after the simulation execution is completed, the target parent application interface is restored according to the interface information. For example, when the native authorization function is called by the automation script, the authorization operation behavior is simulated and executed on the target element in the child application page based on the native authorization function, then, a simulated authorization popup window is popped up first, then the simulated authorization popup window disappears, and finally, an allowed or rejected result is returned to the native authorization function of the parent application rewritten in the child application automation toolkit.
In one embodiment, the terminal may intercept (mock) the native execution function of the parent application through the child application automation toolkit and then rewrite the intercepted native execution function to the child application automation toolkit. For example, the child application automation toolkit may intercept the native execution Function of the parent application, miniprogram.
In the above embodiment, the native execution function of the parent application and the corresponding parent application interface are written into the child application automation toolkit in advance by using the capability of the child application automation toolkit, so that the interface restoration of the native behavior of the parent application is realized, and compared with the conventional method in which the interface is only limited to the atomic application, the integrity of the restoration of the operation track is greatly ensured.
In one embodiment, step 202 comprises: and if the event type in the current operation behavior log is the second event type, calling a corresponding non-native execution function from the preset function library. In this embodiment, step 208 includes: and after the target operation behavior is simulated and executed on the target element based on the non-native execution function, restoring and generating a corresponding sub-application page according to the sub-application code.
Wherein the second event type is an event type that does not trigger the generation of a native behavior of the parent application. That is, the second event type refers to an event type that generates a behavior only within the child application station. The non-native execution function is an execution function that does not trigger the generation of native behavior of the parent application after execution.
Specifically, if the event type in the current operation behavior log is the second event type, the operation behavior to be simulated recorded in the current operation behavior log is described, and the generation of the native behavior of the parent application is not triggered, so that the terminal can call a corresponding non-native execution function from a preset function library through an automation script, simulate and execute the target operation behavior on the target element based on the non-native execution function, and then restore and generate a corresponding child application page according to the child application code corresponding to the current operation behavior log. It can be understood that since the generation of the native behavior of the parent application is not triggered, the execution of the target operation behavior does not generate the parent application interface, but restores the corresponding child application page.
In the embodiment, the interface reduction is performed in a targeted manner by analyzing and judging the event type, so that the accuracy of the interface reduction is greatly improved, and the accuracy of the operation track reduction is further improved. In addition, unnecessary loss of system resources caused by miscalling of the executive function is avoided, and therefore the system resources are saved.
In one embodiment, the operation behavior log array is generated by a log array generating step, which includes: acquiring source log data of a target sub application; screening an operation behavior log related to an operation from the source log data; sequencing the operation behavior logs according to the behavior occurrence sequence, and performing format conversion on the sequenced operation behavior logs to obtain an operation behavior log array for representing an operation track; and the format of each operation behavior log in the operation behavior log array is a format which can be identified by an automation script.
It is to be understood that the log array generating step may be executed by the terminal, by the server, or by interaction between the terminal and the server, which is not limited in this respect. In this embodiment, the example of the server executing the log array generation step is only schematically described.
The source log data is original plain text log data which is applied by the target sub-application and is not subjected to operation behavior screening processing. The source log data includes log information that is not related to the operation behavior in addition to log information related to the operation behavior. Such as a serial number, a version number, and the like, of the log information that are not related to the operation behavior.
Wherein obtaining source log data comprises: and acquiring the front-end log of the target sub-application from the log system to obtain source log data.
It can be understood that the source log data includes a lot of log information unrelated to the operation behavior, and the format of the source log data is not directly recognizable by the automation script, so that the source log data is not suitable for being directly called by the automation script.
Therefore, the server can obtain the source log data of the target sub-application, screen out operation behavior logs related to the operation from the source log data, such as filtering hidden page information with empty content and filtering the state of non-focus of the interface dom, filter a non-current small program interface, obtain all elements of the current interface as the operation behavior logs, and sort the operation behavior logs according to the occurrence sequence of the behaviors. The server can sequentially perform format conversion on each sequenced operation behavior log to obtain an operation behavior log array used for representing the operation track. It is to be appreciated that the format of each operational behavior log in the operational behavior log array is a format recognizable by the automation script.
In one embodiment, the server may use a cloud function to screen out operation behavior logs related to operations from the source log data. Each operation behavior log has corresponding time, and the time is used for representing the occurrence time of the operation behavior recorded by the operation behavior log. Therefore, the server may sort the operation behavior logs in a corresponding time ascending order using the cloud function.
In an embodiment, for each operation behavior log in turn, the server may extract information related to the operation behavior (i.e., information related to the operation behavior) from the operation behavior log, format the information related to the operation behavior according to a preset format that can be recognized by the automation script, and then combine results of formatting each operation behavior log to generate an operation behavior log array that can be recognized by the automation script. For example, for each operation behavior log in sequence, the server may extract the relevant information of the operation behavior, such as the event type, the page address, the information carried in the report, and the like, from the operation behavior log, and format the information, thereby generating an operation behavior log array.
For ease of understanding, reference is now made to fig. 3 and 4 for a schematic illustration. Fig. 3 shows the collected source log data, and as can be seen from fig. 3, the source log data is simply stored in time, and includes not only the information related to the operation behavior but also a lot of noise information unrelated to the operation behavior, and such log format cannot be recognized by the automation script. FIG. 4 is used to illustrate an operational behavior log array. As can be seen from fig. 4, the operation behavior log array has no redundant information that is irrelevant to the operation behavior, and includes the operation behavior logs related to the operation behavior that are screened out, and the operation behavior logs are ordered in sequence according to the occurrence order of the behavior from entering the child application. Moreover, each operation behavior log is subjected to specific format conversion processing and can be identified by an automatic script.
In the embodiment, the operation behavior related logs are screened from a large amount of complicated source log data of the sub-application, the operation behavior logs are screened out, and format conversion processing is performed, so that unnecessary data interference is greatly reduced, and the efficiency of subsequent operation track restoration is improved. In addition, format conversion processing is carried out, so that the operation behavior log array can be identified by the automatic script, the operation behavior track is automatically and visually restored, and the operation behavior positioning efficiency and accuracy are greatly improved.
In one embodiment, the method further comprises: through automation scripting, the promoter applies the developer tool. In this embodiment, based on the execution function, the target operation behavior is simulated and executed on the target element to restore and generate a corresponding interface: in the sub-application developer tool, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
The child application developer tool is a developer tool for developing and debugging child applications of the parent application. Developer tools (IDEs), a type of application that assists in developing computer programs. The sub-application development tool can be used for providing a visual operation interface to help developers complete the development work of the sub-applications.
Specifically, a sub-application developer tool is installed in the terminal. After the terminal runs the automation script, the application developer tool can be automatically started through the automation script. After the current operation behavior log is determined from the operation behavior log array through the automation script, the terminal can obtain the sub-application code corresponding to the current operation behavior log through the automation script.
It should be noted that, the starting application developer tool may be executed before the step calls the corresponding function from the preset function library, and the specific starting time of the starting application developer tool is not limited herein.
In one embodiment, the service port of the sub-application developer tool may be set to open in advance at the security setting of the sub-application developer tool. The automation service ports of the child application developer tool can then be connected by running an automation script, and the child application developer tool can be automatically launched upon connection of the automation service ports.
The promoter application developer tool is now schematically illustrated in connection with FIG. 5. Fig. 5 (a) is a diagram for illustrating an opening setting interface of a service port of the sub application developer tool. After the service port is opened, an automation script' node weather-automation. Further, the automation script may then automatically launch the application developer tool. (c) The figure is a sub-application interface displayed after the promoter application developer tool.
After the sub-application developer tool is started, the terminal can automatically control the sub-application developer tool according to the automatic script codes, sequentially determine the current operation behavior log from the operation behavior log array, and execute corresponding processing aiming at the current operation behavior log, so that the operation behavior of the user on the target sub-application is simulated in one step. Specifically, the terminal may call an execution function corresponding to an event type in the current operation behavior log from a preset function library provided by the sub-application automation tool, and further, the terminal may simulate, in the sub-application developer tool, an execution target operation behavior on a target element in the sub-application code through the called execution function, so as to restore and generate a corresponding interface.
It should be noted that, if the event type is the first event type, the terminal may simulate, in the sub-application developer tool, the target operation behavior of the target element based on the called native execution function, and restore the target parent application interface according to the interface information after the simulation execution is completed. If the event type is the second event type, the terminal can simulate and execute the target operation behavior on the target element based on the called non-native execution function in the sub-application developer tool, and then restore and generate a corresponding sub-application page according to the sub-application code corresponding to the current operation behavior log.
That is, the terminal may generate, in the child application developer tool, a target parent application interface or a child application page corresponding to the current operation behavior log in a simulation manner through the called execution function. The sub-application page is a page generated when the target sub-application is simulated to execute the operation behavior recorded in the current operation behavior log.
FIG. 6 is a diagram of a simulated sub-application page in one embodiment. FIG. 6 is a sub-application page generated in the sub-application developer tool when the operation behavior occurred in the simulation execution of the target sub-application is generated. It can be understood that the sub-application page illustrated in fig. 6 is generated when the user operates before, and according to the method of the embodiment of the present application, the operation behavior log is utilized to perform the restoration presentation in the sub-application developer tool.
In the above embodiment, in the sub-application developer tool, when each operation behavior is simulated and executed, a corresponding interface can be generated, and when the operation behaviors are executed in sequence, the whole operation track of the user when the user uses the sub-application can be restored through the interface in the sub-application developer tool. The whole operation track of the user in use can be restored quickly and intuitively without complicated and large amount of manual query operation by the user, and the efficiency is greatly improved. And then when the problem needs to be positioned, the problem can be quickly positioned based on the representation operation track restoration interface, and the efficiency of positioning and solving the problem is improved. In addition, the interface corresponding to each operation behavior log is continuously restored, which is equivalent to dynamically reproducing the whole process when the user uses the sub-application, and is very intuitive and accurate like screen recording and playing. Moreover, the visualized restoration of the operation track can be realized through the sub-application developer tool without additional equipment resources, so that the equipment resource cost is saved.
In one embodiment, the method further comprises: uploading the automation script and the operation behavior log array; the uploaded automation script and the operation behavior log array are associated with a target sub application; and generating a graphic code corresponding to the target sub-application. In this embodiment, sequentially determining, by the automation script, a current operation behavior log from an operation behavior log array corresponding to the target sub-application includes: and under the condition that a terminal of a parent application provided with the target child application downloads the automation script and the operation behavior log array by scanning the graphic code, sequentially determining the current operation behavior log from the operation behavior log array by running the automation script in the terminal.
And after the graphic code corresponding to the target sub-application is scanned, downloading an automation script and the operation behavior log array which are associated with the target sub-application.
Since the present embodiment relates to two terminals, for clarity of presentation, a first terminal and a second terminal are used for distinguishing presentation. The first terminal is a terminal for initially installing the automation script and subsequently generating the graphic code. The second terminal is a terminal installed with the parent application, i.e. a terminal for subsequently scanning the graphic code.
Specifically, the first terminal, which has the automation script installed initially, may execute step 202, i.e., run the automation script to obtain the operation behavior log array through the automation script. After the first terminal obtains the operation behavior log array through the automation script, the first terminal can upload the automation script and the operation behavior log array to the server, so that the server associates the uploaded automation script and the operation behavior log array with the target sub-application. The first terminal may generate a graphic code corresponding to the target sub-application. The user may scan the graphic code using a second terminal installed with a parent application (i.e., a parent application of the target sub-application) to download the automation script and the operational behavior log array associated with the target sub-application.
Then, in the second terminal for scanning the graphic code, triggering and running the automatic script, sequentially determining a current operation behavior log from a downloaded operation behavior log array through the running automatic script, and executing a function called from the preset function library according to the event type in the current operation behavior log; and simulating and executing subsequent steps such as the operation behavior recorded by the current operation behavior log and the like on the target sub-application based on the called function, so that an operation track restoration interface of the target sub-application is generated in the second terminal for scanning the graphic code based on the parent application installed on the second terminal.
In one embodiment, the simulating, based on the called function, the operation behavior recorded by executing the current operation behavior log to the target sub-application includes: and in the parent application running in the terminal, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
Specifically, the second terminal scanning the graphic code sequentially determines current operation behavior logs from the downloaded operation behavior log array by running the downloaded automation script, and for each current operation behavior log, the second terminal may call, according to an event type in the current operation behavior log, an execution function corresponding to the event type from a preset function library. The second terminal can simulate and execute target operation behaviors on the target elements in the installed parent application based on the execution function so as to restore and generate the corresponding interfaces.
It should be noted that, if the event type is the first event type, the second terminal may simulate, in the installed parent application, the target operation behavior on the target element based on the called native execution function, and restore the target parent application interface according to the interface information after the simulation execution is completed. If the event type is the second event type, the second terminal can simulate and execute the target operation behavior on the target element in the installed parent application based on the called non-native execution function, and then restore and generate a corresponding child application page according to the child application code corresponding to the current operation behavior log. The sub-application page is a page generated when the target sub-application is simulated to execute the operation behavior recorded in the current operation behavior log.
In the above embodiment, the real machine (i.e., the second terminal) installed with the parent application scans the graphic code, that is, the corresponding interface generated when the user performs each operation behavior can be restored on the real machine in sequence, so that the entire operation track of the user can be visually restored in the real machine. The whole operation track of the user in use can be restored quickly and intuitively without complicated and large amount of manual query operation by the user, and the efficiency is greatly improved. And then when the problem needs to be positioned, the problem can be quickly positioned based on the restored operation track, and the efficiency of positioning and solving the problem is improved. In addition, the interface corresponding to each operation behavior log is continuously restored, which is equivalent to dynamically reproducing the whole process when the user uses the sub-application, and is very intuitive and accurate like screen recording and playing. Moreover, the code is scanned through a real machine, so that the visual restoration of the whole operation track can be conveniently realized, the limitation caused by the fact that the operation track must be restored on specific equipment is avoided, and the flexibility is greatly improved.
FIG. 7 is a schematic diagram illustrating a trajectory reduction method in one embodiment. As can be seen from fig. 7, the server may obtain the source log data of the target sub-application from the log data source, and process the source log data through the cloud function severless, that is, perform screening and formatting processing related to the operation behavior, so as to generate the operation behavior log array. The first terminal can run the automation script to obtain the operation behavior log array from the server. Wherein, the operation track of the target sub-application can be restored by at least one of the following two ways. The first mode is as follows: locally restoring an operation track of a target sub-application at a first terminal; the second mode is as follows: the operation track of the target sub-application can also be restored on the real machine (i.e. the second terminal installed with the parent application). It will be appreciated that the real machine has a parent application installed therein.
For the first way, i.e. if the operation track of the target sub-application is locally restored at the first terminal, the first terminal may start the sub-application developer tool through the automation script. Then, sequentially determining current operation behavior logs from the operation behavior log array through the automation script, acquiring a sub-application code corresponding to the current operation behavior logs from a front-end item source code through the automation script for each current operation behavior log, and calling an element acquisition function from a preset function library provided by a sub-application automation toolkit to acquire a target element acted by a target operation behavior from the sub-application code. The first terminal can also call an execution function corresponding to the event type in the current operation behavior log from a preset function library provided by the sub-application automation toolkit, and further simulate and execute a target operation behavior on a target element in the sub-application developer tool based on the called execution function so as to restore and generate a corresponding interface.
It can be understood that, if the event type is the first event type, the first terminal may simulate, in the sub-application developer tool, to execute a target operation behavior on the target element based on the called native execution function, and restore the target parent application interface according to the interface information after the simulation execution is completed. If the event type is the second event type, the first terminal can simulate and execute the target operation behavior on the target element in the sub-application developer tool based on the called non-native execution function, and then restore and generate a corresponding sub-application page according to the sub-application code corresponding to the current operation behavior log.
For the second mode, if the operation track of the target sub-application is restored on the real machine, the first terminal may upload the automation script and the operation behavior log array, and generate the graphic code corresponding to the target sub-application. The graphic code may be scanned using a real machine to download an automation script and an operational behavior log array. The real machine can run an automation script, and sequentially determine the current operation behavior logs from the operation behavior log array through the automation script. For each current operation behavior log, the real machine can obtain a sub-application code corresponding to the current operation behavior log from a front-end project source code through an automation script, and call an element obtaining function from a preset function library provided by a sub-application automation toolkit to obtain a target element acted by a target operation behavior from the sub-application code. The first terminal can also call an execution function corresponding to the event type in the current operation behavior log from a preset function library provided by the sub-application automation toolkit, and further simulate and execute a target operation behavior on a target element in a parent application operated by the real machine based on the called execution function so as to restore and generate a corresponding interface.
It can be understood that if the event type is the first event type, the real machine may simulate, in the installed parent application, the execution of the target operation behavior on the target element based on the called native execution function, and restore the target parent application interface according to the interface information after the simulation execution is completed. If the event type is the second event type, the real machine can simulate and execute the target operation behavior on the target element in the installed parent application based on the called non-native execution function, and then restore and generate a corresponding child application page according to the child application code corresponding to the current operation behavior log.
In one embodiment, the simulating, based on the called function, the operation behavior recorded by executing the current operation behavior log to the target sub-application includes: if the event type is a page jump event in the sub-application, acquiring a page address of a first sub-application page to be jumped to from the current operation behavior log, and simulating to execute a page jump operation on the target element based on a called page jump function so as to jump to the first sub-application page pointed by the page address.
It is to be understood that page jump events within the sub-application, i.e. events that make a page jump within the sub-application, do not involve events that jump to the parent application. It should be noted that the page jump event in the sub-application is an in-station jump event, and may include different page jump events in the same sub-application, and may also include page jump events between different sub-applications, which is not limited herein. It will be appreciated that the page jump event within the child application is of a second event type, i.e. an event type that does not trigger the generation of native behaviour of the parent application.
Specifically, in the case that the event type in the current operation behavior log is a page jump event in the sub-application, the called execution function is a page jump function. The current operation behavior log further includes a page address of the first sub application page to be skipped to, and the terminal can obtain the page address from the current operation behavior log. The terminal can simulate and execute a page jump operation on the target element based on the called page jump function so as to jump to the first sub application page pointed by the page address.
For example, if the event type of the current operation behavior log is an entrpage in the sub-application, that is, a page jump event, a specific page address corresponding to a path field (that is, a page address field) may be obtained from the current operation behavior log, and a jump function miniprogam.
It is to be appreciated that the page jump event can jump to a page jump event of the parent application, i.e., an event type (i.e., a first event type) for triggering generation of a native behavior of the parent application, in addition to a page jump event within the child application. Then, for a page jump event of jumping to the parent application, a corresponding native execution function may be called from the preset function library, interface information of a target parent application interface generated by simulation in advance is acquired from the child application automation toolkit, the target operation behavior is simulated and executed on the target element based on the native execution function, and after the simulation execution is completed, the target parent application interface restored according to the interface information is jumped to.
In one embodiment, in step 204, invoking an element obtaining function from a preset function library provided by a sub-application automation toolkit to obtain, from the sub-application code, a target element on which a target operation behavior acts, includes: if the event type is a click event, acquiring an identifier of a target element to be clicked in a second sub application page from the current operation behavior log, and calling an element acquisition function from a preset function library provided by a sub application automation toolkit to acquire the target element corresponding to the target element identifier from the sub application code. In this embodiment, step 208 includes: and simulating and executing the clicking operation of the target element in the second sub application page based on the called clicking function corresponding to the clicking event.
The second sub-application page is a sub-application page on which the click event acts. It will be appreciated that the sub-application page needs to be acted upon to simulate the execution of a click operation with respect to a target element in the sub-application page.
Specifically, in the case that the event type in the current operation behavior log is a click event, the called execution function is a click function. The current operation behavior log further includes an identifier of a target element to be clicked in the second sub application page, and the terminal may obtain the identifier of the target element from the current operation behavior log, for example, a name of the target element or a character string used for a unique target element. The terminal can call an element obtaining function from a preset function library provided by the sub-application automation toolkit through the automation script so as to obtain a target element corresponding to the target element identifier from the sub-application code of the second sub-application page. The terminal can simulate and execute the clicking operation of the target element in the second sub application page based on the called clicking function.
For example, if the event type is click, that is, a click event, a target element corresponding to an element field (that is, a page element field) may be obtained from the current operation behavior log, and a click function element.
In one embodiment, the method further comprises: and if the event type is an input event, simulating and executing corresponding input operation on the target element according to the input data recorded in the current operation behavior log and based on the called input function.
Specifically, in the case that the event type in the current operation behavior log is an input event, the called execution function is an input function. The current operation behavior log further includes input data, and the terminal can obtain the input data from the current operation behavior log. The terminal can perform corresponding input operation on the target element simulation for the input data based on the called input function to input the input data.
For example, if the event type is input, i.e., a click event, the input data corresponding to the value field (i.e., the key value field corresponding to the input data) may be obtained from the current operation behavior log, and an input function element in a preset function library provided by the sub application automation toolkit is called, so as to simulate the input with the input data corresponding to the value field.
In the above embodiment, the function library provides various functions capable of automatically simulating the execution operation behavior, and further, the automation script may automatically simulate any past operation behavior of the execution user based on the called execution function, so that the visual reduction of the operation trajectory is realized, and the reduction efficiency and effect are improved.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a part of the steps in each flowchart may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 8, an operation trace restoring apparatus is provided, which may be a part of a computer device using a software module or a hardware module, or a combination of the two modules, and specifically includes: an obtaining module 802, a calling module 804, and a simulation restoring module 806, wherein:
an obtaining module 802, configured to sequentially determine, through an automation script, a current operation behavior log from an operation behavior log array corresponding to a target sub-application; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence;
a calling module 804, configured to obtain, through the automation script, a sub-application code corresponding to the current operation behavior log, and call an element obtaining function from a preset function library provided by a sub-application automation toolkit, so as to obtain, from the sub-application code, a target element on which a target operation behavior acts; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element in the document object model on which the target operation behavior acts;
the calling module 804 is further configured to call a corresponding execution function from the preset function library according to the event type in the current operation behavior log;
a simulation restoring module 806, configured to perform the target operation behavior on the target element in a simulated manner based on the execution function, so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
In an embodiment, the invoking module 804 is further configured to, if the event type in the current operation behavior log is a first event type, invoke a corresponding native execution function from the preset function library, and obtain interface information of a target parent application interface generated in advance through simulation from the child application automation toolkit; the first event type is used for triggering the event type generating the native behavior of the parent application; the target parent application interface is an interface displayed by the parent application when the generation of the parent behavior of the parent application is triggered; the native execution function is an execution function that triggers the generation of native behavior of the parent application upon execution.
The simulation restoring module 806 is further configured to simulate and execute the target operation behavior on the target element based on the native execution function, and restore the target parent application interface according to the interface information after the simulation execution is completed.
In an embodiment, the invoking module 804 is further configured to invoke a corresponding non-native execution function from the preset function library if the event type in the current operation behavior log is a second event type; the second event type is an event type which does not trigger the generation of the native behavior of the parent application; the non-native execution function is an execution function that does not trigger generation of native behavior of the parent application after execution. The simulation restoring module 806 is further configured to restore and generate a corresponding sub-application page according to the sub-application code after the target operation behavior is simulated and executed on the target element based on the non-native execution function.
In one embodiment, the obtaining module 802 is further configured to obtain source log data of the target sub-application; screening an operation behavior log related to operation from the source log data; sequencing the operation behavior logs according to the behavior occurrence sequence, and performing format conversion on the sequenced operation behavior logs to obtain an operation behavior log array for representing an operation track; and the format of each operation behavior log in the operation behavior log array is a format which can be identified by an automation script.
In one embodiment, the simulation restoration module 806 is further configured to launch the sub-application developer tool via the automation script; in the sub-application developer tool, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
As shown in fig. 9, in one embodiment, the apparatus further comprises:
a generating module 801, configured to upload the automation script and the operation behavior log array; the uploaded automation script and the operation behavior log array are associated with a target sub application; generating a graphic code corresponding to the target sub-application; and the graphic code is used for downloading the automation script and the operation behavior log array which are associated with the target sub application after being scanned.
The calling module 804 is further configured to, in a case where a terminal of a parent application in which the target child application is installed downloads the automation script and the operation behavior log array by scanning the graphic code, sequentially determine a current operation behavior log from the operation behavior log array by running the automation script in the terminal.
In one embodiment, the simulation restoring module 806 is further configured to, in the parent application running in the terminal, simulate and execute the target operation behavior on the target element based on the execution function, so as to restore and generate a corresponding interface.
In an embodiment, the simulation restoring module 806 is further configured to, if the event type is a page jump event in a sub application, obtain a page address of a first sub application page to be jumped to from the current operation behavior log, and perform, based on a called page jump function, a page jump operation on the target element in a simulation manner, so as to jump to the first sub application page pointed to by the page address.
In an embodiment, the simulation restoring module 806 is further configured to, if the event type is a click event, obtain, from the current operation behavior log, an identifier of a target element to be clicked in the second sub application page; calling an element obtaining function from a preset function library provided by a sub-application automation toolkit so as to obtain a target element corresponding to the target element identifier from a sub-application code of the second sub-application page; and simulating and executing the clicking operation of the target element in the second sub application page based on the called clicking function corresponding to the clicking event.
In an embodiment, the simulation restoring module 806 is further configured to, if the event type is an input event, perform corresponding input operation on the target element simulation according to the input data recorded in the current operation behavior log and based on a called input function.
The operation track restoring device acquires the operation behavior log array through the automation script, sequentially determines the current operation behavior log from the operation behavior log array, and acquires the sub application code corresponding to the current operation behavior log through the automation script. Acquiring a target element acted by a target operation behavior from a sub-application code by using an element acquisition function provided by a sub-application automation toolkit, and calling a corresponding execution function from the preset function library according to an event type in the current operation behavior log; and simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface. Because the operation behavior log array can be identified by the automatic script, the operation behavior log array only contains log information which is arranged in sequence and is relevant to the operation behavior after a large amount of complicated text log information of the sub-application is screened and formatted, and unnecessary data interference is greatly reduced. And restoring to generate a corresponding interface when each operation behavior is simulated and executed, and restoring the generated continuous interface for each operation behavior log in sequence to represent the operation track for the target sub-application. Equivalently, the operation behavior log array only related to the operation behavior is automatically restored based on the automatic script code, the sub-application automation toolkit and the operation behavior log array, the whole operation track of the user in use can be quickly and intuitively restored without complicated and large amount of manual query operation of the user, and the efficiency is greatly improved.
For specific limitations of the operation trajectory restoring device, reference may be made to the above limitations of the operation trajectory restoring method, which is not described herein again. The modules in the operation trajectory restoration device may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an operation trajectory restoration method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.
Claims (12)
1. An operation trajectory restoration method, characterized in that the method comprises:
sequentially determining current operation behavior logs from an operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence;
acquiring a sub-application code corresponding to the current operation behavior log through the automation script, and calling an element acquisition function from a preset function library provided by a sub-application automation toolkit to acquire a target element acted by a target operation behavior from the sub-application code; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element which is in a document object model corresponding to the sub application code and is acted on by the target operation behavior; the sub-application code is code of a sub-application page on which the target operation behavior acts; the child application automation toolkit is a toolkit for manipulating child application developer tools and parent applications in a real machine; the preset function library is preset for realizing the automatic operation of the sub-application by the sub-application automation toolkit; the element acquisition function is used for acquiring elements in the document object model corresponding to the sub application codes;
calling a corresponding execution function from the preset function library according to the event type in the current operation behavior log;
simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
2. The method according to claim 1, wherein the calling the corresponding execution function from the preset function library according to the event type in the current operation behavior log comprises:
if the event type in the current operation behavior log is the first event type, then
Calling a corresponding native execution function from the preset function library, and acquiring interface information of a target parent application interface generated in advance in a simulation mode from the child application automation toolkit; the first event type is used for triggering the event type which generates the native behavior of the parent application; the target parent application interface is an interface displayed by the parent application when the generation of the parent behavior of the parent application is triggered; the native execution function is an execution function which triggers the generation of the native behavior of the parent application after execution;
the simulating and executing the target operation behavior on the target element based on the execution function to restore and generate a corresponding interface comprises:
and simulating and executing the target operation behavior on the target element based on the native execution function, and restoring the target parent application interface according to the interface information after the simulation execution is finished.
3. The method according to claim 2, wherein the calling the corresponding execution function from the preset function library according to the event type in the current operation behavior log further comprises:
if the event type in the current operation behavior log is the second event type, then
Calling a corresponding non-native execution function from the preset function library; the second event type is an event type which does not trigger the generation of the native behavior of the parent application; the non-native execution function is an execution function which does not trigger the generation of the native behavior of the parent application after execution;
the simulating and executing the target operation behavior on the target element based on the execution function to restore and generate a corresponding interface comprises:
and after the target operation behavior is simulated and executed on the target element based on the non-native execution function, restoring and generating a corresponding sub-application page according to the sub-application code.
4. The method of claim 1, wherein the operation behavior log array is generated by a log array generating step, the log array generating step comprising:
acquiring source log data of the target sub-application;
screening an operation behavior log related to an operation from the source log data;
sequencing the operation behavior logs according to the behavior occurrence sequence, and performing format conversion on the sequenced operation behavior logs to obtain an operation behavior log array for representing an operation track; and the format of each operation behavior log in the operation behavior log array is a format which can be identified by an automation script.
5. The method of claim 1, further comprising:
launching, by the automation script, a developer tool;
the simulating and executing the target operation behavior on the target element based on the execution function to restore and generate a corresponding interface comprises:
in the sub-application developer tool, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
6. The method of claim 1, further comprising:
uploading the automation script and the operation behavior log array; the uploaded automation script and the operation behavior log array are associated with a target sub application;
generating a graphic code corresponding to the target sub-application; the graphic code is used for downloading an automation script and the operation behavior log array which are associated with the target sub-application after being scanned;
the method for sequentially determining the current operation behavior logs from the operation behavior log array corresponding to the target sub-application through the automatic script comprises the following steps:
and under the condition that a terminal of a parent application provided with the target child application downloads the automation script and the operation behavior log array by scanning the graphic code, sequentially determining the current operation behavior log from the operation behavior log array by running the automation script in the terminal.
7. The method of claim 6, wherein said performing the target operation behavior on the target element simulation based on the execution function to generate a corresponding interface comprises:
and in the parent application running in the terminal, simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface.
8. The method according to any one of claims 1 to 7, wherein the performing the target operation behavior on the target element simulation based on the execution function to generate the corresponding interface includes:
if the event type is a page jump event in the sub-application, then
And acquiring a page address of a first sub-application page to be jumped to from the current operation behavior log, and simulating and executing a page jump operation on the target element based on a called page jump function so as to jump to the first sub-application page pointed by the page address.
9. The method according to any one of claims 1 to 7, wherein the calling an element obtaining function from a preset function library provided by a sub application automation toolkit to obtain a target element acted on by a target operation behavior from the sub application code comprises:
if the event type is a click event, acquiring an identifier of a target element to be clicked in a second sub application page from the current operation behavior log;
calling an element acquisition function from a preset function library provided by a sub-application automation toolkit to acquire a target element corresponding to the target element identifier from a sub-application code of the second sub-application page;
the simulating and executing the target operation behavior on the target element based on the execution function to restore and generate a corresponding interface comprises:
and simulating and executing the click operation of the target element in the second sub application page based on the called click function corresponding to the click event.
10. An operation trajectory restoration device, characterized in that the device comprises:
the acquisition module is used for sequentially determining the current operation behavior logs from the operation behavior log array corresponding to the target sub-application through the automation script; the operation behavior log array comprises operation behavior logs arranged according to a behavior occurrence sequence;
the calling module is used for acquiring the sub-application codes corresponding to the current operation behavior logs through the automation script, and calling an element acquisition function from a preset function library provided by a sub-application automation toolkit so as to acquire target elements acted by target operation behaviors from the sub-application codes; the target operation behavior is the operation behavior to be simulated recorded by the current operation behavior log; the target element is an element which is in a document object model corresponding to the sub application code and is acted on by the target operation behavior; the sub-application code is code of a sub-application page on which the target operation behavior acts; the child application automation toolkit is a toolkit for manipulating child application developer tools and parent applications in a real machine; the preset function library is preset for realizing the automatic operation of the sub-application by the sub-application automation toolkit; the element acquisition function is used for acquiring elements in the document object model corresponding to the sub application codes;
the calling module is also used for calling a corresponding execution function from the preset function library according to the event type in the current operation behavior log;
the simulation restoration module is used for simulating and executing the target operation behavior on the target element based on the execution function so as to restore and generate a corresponding interface; and restoring the generated continuous interface for each operation behavior log in sequence, wherein the generated continuous interface is used for representing the operation track for the target sub-application.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110638750.1A CN113342629B (en) | 2021-06-08 | 2021-06-08 | Operation track restoration method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110638750.1A CN113342629B (en) | 2021-06-08 | 2021-06-08 | Operation track restoration method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113342629A CN113342629A (en) | 2021-09-03 |
CN113342629B true CN113342629B (en) | 2023-03-07 |
Family
ID=77475459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110638750.1A Active CN113342629B (en) | 2021-06-08 | 2021-06-08 | Operation track restoration method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113342629B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114020191A (en) * | 2021-11-09 | 2022-02-08 | 中国工商银行股份有限公司 | Operation video generation method and device of service page, computer equipment and medium |
CN115982507B (en) * | 2023-03-17 | 2023-06-16 | 一临云(深圳)科技有限公司 | Recording method, device, equipment and storage medium for triggering operation of application program |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107800591A (en) * | 2017-11-07 | 2018-03-13 | 南威软件股份有限公司 | A kind of analysis method of unified daily record data |
CN108287786A (en) * | 2017-01-09 | 2018-07-17 | 北京四维图新科技股份有限公司 | A kind of automated testing method and device and hybrid navigation system based on map |
CN109062780A (en) * | 2018-06-25 | 2018-12-21 | 深圳市远行科技股份有限公司 | The development approach and terminal device of automatic test cases |
CN110489698A (en) * | 2019-08-16 | 2019-11-22 | 南京云帐房网络科技有限公司 | A kind of system and method for automation collection web data |
US10853218B1 (en) * | 2018-12-17 | 2020-12-01 | Shutterstock, Inc. | Recording and playback of a web browser session |
CN112148571A (en) * | 2020-07-08 | 2020-12-29 | 青岛窗外科技有限公司 | Method and device for recording and playing back webpage operation process |
CN112559306A (en) * | 2020-11-17 | 2021-03-26 | 贝壳技术有限公司 | User behavior track obtaining method and device and electronic equipment |
CN112613067A (en) * | 2020-12-16 | 2021-04-06 | 平安普惠企业管理有限公司 | User behavior data acquisition method and device, computer equipment and storage medium |
CN112905936A (en) * | 2021-02-10 | 2021-06-04 | 微民保险代理有限公司 | Page recording animation generation method, page operation log query method and computer equipment |
-
2021
- 2021-06-08 CN CN202110638750.1A patent/CN113342629B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108287786A (en) * | 2017-01-09 | 2018-07-17 | 北京四维图新科技股份有限公司 | A kind of automated testing method and device and hybrid navigation system based on map |
CN107800591A (en) * | 2017-11-07 | 2018-03-13 | 南威软件股份有限公司 | A kind of analysis method of unified daily record data |
CN109062780A (en) * | 2018-06-25 | 2018-12-21 | 深圳市远行科技股份有限公司 | The development approach and terminal device of automatic test cases |
US10853218B1 (en) * | 2018-12-17 | 2020-12-01 | Shutterstock, Inc. | Recording and playback of a web browser session |
CN110489698A (en) * | 2019-08-16 | 2019-11-22 | 南京云帐房网络科技有限公司 | A kind of system and method for automation collection web data |
CN112148571A (en) * | 2020-07-08 | 2020-12-29 | 青岛窗外科技有限公司 | Method and device for recording and playing back webpage operation process |
CN112559306A (en) * | 2020-11-17 | 2021-03-26 | 贝壳技术有限公司 | User behavior track obtaining method and device and electronic equipment |
CN112613067A (en) * | 2020-12-16 | 2021-04-06 | 平安普惠企业管理有限公司 | User behavior data acquisition method and device, computer equipment and storage medium |
CN112905936A (en) * | 2021-02-10 | 2021-06-04 | 微民保险代理有限公司 | Page recording animation generation method, page operation log query method and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113342629A (en) | 2021-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9098636B2 (en) | White-box testing systems and/or methods in web applications | |
Amalfitano et al. | Testing android mobile applications: Challenges, strategies, and approaches | |
Almeida et al. | Testing tools for Android context-aware applications: a systematic mapping | |
WO2013188540A1 (en) | Practical natural-language human-machine interfaces | |
CN113342629B (en) | Operation track restoration method and device, computer equipment and storage medium | |
Du et al. | TraceGen: User activity emulation for digital forensic test image generation | |
CN111414309B (en) | Automatic test method of application program, computer equipment and storage medium | |
CN111796799B (en) | Sub-application development method and device, computer equipment and storage medium | |
CN112199284A (en) | Program automation testing method and corresponding device, equipment and medium | |
CN113590454A (en) | Test method, test device, computer equipment and storage medium | |
Arlt et al. | Trends in model-based gui testing | |
CN116166525A (en) | Method and device for generating test script | |
CN110232018A (en) | Interface test method, device, computer equipment | |
CN113051095A (en) | Method and device for reproducing operation errors of client, electronic equipment and storage medium | |
US10430309B2 (en) | Duplicating a task sequence from a graphical user interface interaction for a development application in view of trace data | |
Sams | Selenium Essentials | |
CN107193734B (en) | Playback method and playback system for mobile Web applications | |
CN116719736A (en) | Test case generation method and device for testing software interface | |
CN116204172A (en) | Code generation method, device, apparatus, medium and program product | |
CN116521567A (en) | Buried point testing method and device, vehicle and storage medium | |
CN113986768A (en) | Application stability testing method, device, equipment and medium | |
AU2022210541A1 (en) | Multi-faceted site evaluator integrating user defined evaluation engines | |
CN114968627A (en) | System anomaly detection method and device and electronic equipment | |
CN114968687B (en) | Traversal test method, apparatus, electronic device, program product, and storage medium | |
CN116524986B (en) | System level testing method and system for storage products |
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 |