Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings.
The method and the device for monitoring the abnormal exit of the application interface of the application program are suitable for a scene of automatically monitoring the exit operation executed by the application interface of the application program on a mobile terminal, wherein the mobile terminal comprises but is not limited to a mobile phone, a tablet personal computer and the like, and the operating system of the mobile terminal can be an IOS system and the like; the application program may be an application program with a corresponding icon on a terminal screen of the mobile terminal, such as "pay for treasure" and the like, or may also be a sub-application program inside the application program, where the sub-application program has a corresponding icon and/or text and the like on a home page displayed after the application program is started, such as a service inside the "pay for treasure", including "balance treasure" and "transfer" and the like.
The application interface of the application program can be triggered by a user clicking an icon or text on the home page of the application program, and the application interface can comprise two parts: the interface navigation method comprises content display information and interface navigation information, wherein the content display information comprises each function corresponding to a sub-application program, the interface navigation information comprises buttons linked to a previous application interface or a home page, and the interface navigation information can also comprise name information of a current application interface, other information and the like. It should be noted that, the setting of the interface navigation information is triggered by the code and then executed by the IOS system, and if the trigger time of the interface navigation information is not appropriate, for example, if the trigger is triggered when the application interface is exited, the exit exception of the application interface may be caused. The application is to monitor an improper trigger time of the interface navigation information, that is, to determine whether a setting operation of the interface navigation information is triggered during a gesture operation of triggering exit of the application interface performed by a user, and if the setting operation is triggered, it may be determined that the exit operation of the application interface is an abnormal exit operation.
It should be noted that the previous application interface refers to an application interface that can be linked to the current application interface, and the home page refers to a page displayed after the application program is started, and usually, a user cannot exit the home page through gesture operation, that is, the IOS system cannot receive gesture operation for triggering exit of the home page.
Taking an application program as an example of a pay treasure, a home page of the pay treasure may be as shown in fig. 1, wherein an application interface of the pay treasure may be as shown in fig. 2, the application interface may be triggered by a user clicking an icon or text corresponding to "transfer" in fig. 1, content display information of the application interface includes a function corresponding to "transfer" service, and interface navigation information includes a button that can be linked to the home page of the pay treasure: "< Payment treasure" and name information of application interface: "transfer" and the like. When the user clicks the icon or the text corresponding to the "transfer to my friend" in fig. 2, the next application interface can be entered, and the previous application interface of the next application interface is the application interface shown in fig. 2.
As in the foregoing example, after the user clicks the icon or text corresponding to "transfer" in fig. 1, the IOS system may first set the content display information in fig. 2, and then when the code triggers setting of the interface navigation information, the IOS system performs the task of setting the interface navigation information, however, after the content display information is set, before the interface navigation information is set, if the IOS system receives a gesture operation that triggers exiting of the application interface, the existing IOS system may perform the task of setting the interface navigation information triggered by the code during a response gesture operation, which is a vulnerability of the existing IOS system, and during the gesture operation, the task of setting the interface navigation information is performed, which may cause the interface navigation information to be set on the previous application interface or the top page, so that an abnormal display condition of the application interface occurs. In this example, the interface navigation information in fig. 2 is set in fig. 1, and it is obvious that such setting is wrong, that is, the exit operation of the application interface shown in fig. 2 is an abnormal exit operation. In order to avoid the generation of the setting error of the interface navigation information, the method and the device need to monitor the exit operation of the application interface.
Before introducing the monitoring method for abnormal exit of the application interface of the application program, a system for performing the monitoring method is described, as shown in fig. 3, the system may include: an interface monitor 301, a navigation bar monitor 302, and an activity filter 303.
The interface monitor 301 is configured to monitor whether the application interface is about to exit or has exited, where the interface monitor 301 may specifically be configured to, when monitoring a hook (hook) function: when the viewWillDisaptear is called, the situation that the application interface is about to exit is detected, wherein a hook function is obtained by rewriting the viewWillDisaptear of the IOS system; it may be that upon detection of the hook function: when the viewDisaptear is called, the state that the application interface is exited is detected, and a hook function is obtained by rewriting the viewDisaptear of the IOS system.
And the function: viewwilldispear and function: the viewDidDispapear may be called when the IOS system receives a user operation triggering exit from the application interface, where the user operation may refer to a gesture operation of a user, such as a sliding operation from left to right; and may also refer to a click operation of the user, for example, an operation of clicking a button in the interface navigation information. Specifically, the function may be called at the beginning of the user operation: the method comprises the following steps that (1) viewWillDisappear, namely, when user operation starts, an application interface is about to exit; and call the function at the end of the user operation: and (5) viewDidDisappear, namely when the user operation is finished, the application interface is already exited. It is understood that the period of time that the application interface is about to exit to have exited is referred to as the period of time during which the user operation is performed, and also as the vacuum period when the user operation is not completed.
And a navigation bar monitor 302 for monitoring operation of setting interface navigation information of the application interface. Navigation bar monitor 302 may specifically be configured to, upon detecting a hook function: and when the setLeftBarButtonItem, the setRetDehtBarButtonItem and the like are called, the operation of setting the interface navigation information of the application interface is monitored.
The active filter 303 is configured to determine whether a user operation triggering exiting of the application interface is a gesture operation, and if so, invoke the navigation bar monitor 302 to monitor an operation of setting interface navigation information of the application interface during a vacuum period in which the gesture operation is not completed (i.e., during execution of the gesture operation). The activity filter 303 may specifically obtain an operation state of the user operation by calling an Application Programming Interface (API) function provided by the IOS system, and if the operation state is a change of a gesture state (uigesturrecognizarstationstatechanged), it may be determined that the user operation that triggers exiting of the Application Interface is a gesture operation.
Here, the principle of invoking the operation of the navigation bar monitor 302 to monitor the interface navigation information of the setting application interface during the vacuum period in which the gesture operation is not completed is as follows: the method comprises the steps that content display information of an application interface is set by an IOS, operation of setting interface navigation information is triggered by codes and then is executed by an IOS system, after the content display information of the application interface is set by the IOS system, when the codes trigger setting of the interface navigation information, if a user executes gesture operation of quitting the application interface, an existing IOS system executes a task of setting the interface navigation information triggered by the codes during gesture operation, the task of setting the interface navigation information is a vulnerability of the existing IOS system, and during the gesture operation, the task of setting the interface navigation information is executed, so that the interface navigation information is set in a front application interface or a first page, and the situation that the application interface is displayed abnormally occurs.
In addition, the active filter 303 is configured to filter the applications, and specifically, the applications may be filtered according to preset applications recorded in the white list table.
A flowchart of a method for monitoring an application interface of an application program for abnormal exit by the system shown in fig. 3 may be shown in fig. 4, and the method may specifically include the following steps:
step 410, when a gesture operation for triggering exiting of the current application interface is monitored on the terminal screen, whether an operation for setting interface navigation information of the current application interface is monitored during the execution of the gesture operation is judged.
When a gesture operation is performed on the application interface shown in fig. 2, the gesture operation may be as shown in fig. 5, and in fig. 5, the gesture operation may refer to a sliding operation performed by a user on the application interface shown in fig. 2 from left to right on the terminal screen. During the gesture operation, the current application interface undergoes two stages of exiting to exiting, specifically, the current application interface on the terminal screen moves from the leftmost side to the middle position until the current application interface disappears after moving to the right side.
Specifically, the step 410 of monitoring a gesture operation on the terminal screen to trigger exiting of the current application interface may include:
step A: and monitoring user operation for triggering exiting of the current application interface on a terminal screen.
Specifically, the interface monitor 301 may monitor a hook function: and when the viewWillDispear and viewDidDispear are called, indicating that the user operation triggering the exiting of the current application interface is monitored.
And B: and when the user operation is monitored, acquiring the operation state of the user operation.
Upon monitoring the user operation, the interface monitor 301 may send a get instruction to the active filter 303, where the get instruction is used to instruct the active filter 303 to get the operation state of the user operation by calling an API function provided by the IOS system.
And C: and if the operation state of the user operation is the change of the gesture state, determining that the user operation is the gesture operation, and monitoring the gesture operation.
After obtaining the operation state of the user operation, the active filter 303 determines whether the operation state of the user operation is a change of a gesture state (uigesture recogniturestatchanged), and if so, determines that the current user operation is a gesture operation, that is, monitors a gesture operation that triggers exiting of the current application interface.
When monitoring a gesture operation that triggers exiting of the current application interface, the active filter 303 may send a monitoring instruction to the navigation bar monitor 302, so that the navigation bar monitor 302 monitors an operation of setting interface navigation information of the current application interface. Navigation bar monitor 302 may specifically be configured to, upon detecting a hook function: and when the setLeftBarButtonItem, the setRetDehtBarButtonItem and the like are called, the operation of setting the interface navigation information of the current application interface is monitored.
In step 420, if the operation of setting the interface navigation information of the current application interface is monitored, it is determined that the exiting operation of the current application interface is an abnormal exiting operation.
When monitoring the operation of setting the interface navigation information of the current application interface, the navigation bar monitor 302 may send a message indicating that the operation of setting the interface navigation information of the current application interface is monitored to the active filter 303, and after receiving the message, the active filter 303 may determine that the navigation information of the current application interface may be set in the previous application interface or the top page, and thus may determine that the exiting operation of the current application interface is an abnormal exiting operation. When the exiting operation of the current application interface is an abnormal exiting operation, interface navigation information embodied as the current application interface is set to the previous application interface or the home page, for example, the interface navigation information in fig. 2 is set on the home page shown in fig. 1.
Optionally, before the active filter 303 determines that the exiting operation of the current application interface is an abnormal exiting operation, the following steps may also be performed:
step X: and judging whether the application program is the same as the preset application program.
Here, a preset application may be recorded in the white list table of the active filter 303, and the preset application may be an application or other applications whose application interface does not include interface navigation information.
Step Y: and if the application program is different from the preset application program, determining that the exiting operation of the current application interface is an abnormal exiting operation.
Under the condition that the preset application program is an application program of which the application interface does not contain interface navigation information: the application program is different from the preset application program, namely: the application interface of the application program contains interface navigation information, and under the condition that the application interface contains the interface navigation information, the interface navigation information of the current application interface is set in the previous application interface or the home page, so that the problem that the interface navigation information is not consistent with the application interface (the application interface is displayed abnormally) is caused, namely the quitting operation of the current application interface can be determined to be abnormal quitting operation; when the application program is the same as the preset application program, the application interface of the application program does not contain interface navigation information, and the operation of setting the interface navigation information of the application interface does not affect the application interface under the condition that the application program does not contain the interface navigation information, so that the exiting operation of the current application interface can be determined to be normal exiting operation.
Optionally, when the active filter 303 determines that the exiting operation of the current application interface is an abnormal exiting operation, it may further output report information as follows:
as can be seen from the report information, the report information includes: the system comprises a client monitoring plug-in, a Device Name (Device Name), a Device Version number (Device Version), an IOS system Version number (IOS Version), an application Version number (App Version), a test pack Version (Build Version), a Used Memory (Used Memory), a flying fox Version (FlyFox Version), the Name (such as the current title) of the application, a running result (replay) and other running environment parameter information, wherein the FlyFox refers to a client monitoring plug-in. Therefore, the developer can optimize the target application program according to the report information.
The method for monitoring the abnormal exit of the application interface of the application program can automatically monitor the gesture operation of the current application interface which triggers the exit of the application program on a terminal screen, and judge whether the operation of setting the interface navigation information of the current application interface is monitored or not after the gesture operation is monitored to start and before the gesture operation is finished; and if the operation of setting the interface navigation information of the current application interface is monitored, determining that the exiting operation of the current application interface is an abnormal exiting operation. The method and the device can automatically monitor the exit operation of the application interface of the application program, so that the monitoring efficiency of the abnormal exit of the application interface of the application program can be improved.
Corresponding to the above method for monitoring abnormal exit of the application interface of the application program, an embodiment of the present application further provides a device for monitoring abnormal exit of the application interface of the application program, as shown in fig. 6, the device includes:
the determining unit 601 is configured to determine whether an operation of setting interface navigation information of a current application interface is monitored during execution of a gesture operation when the gesture operation of triggering the current application interface exiting an application program is monitored on a terminal screen.
The monitoring of the gesture operation for triggering exiting of the current application interface on the terminal screen specifically includes:
monitoring user operation for triggering exiting of the current application interface on a terminal screen;
when the user operation is monitored, acquiring the operation state of the user operation;
and if the operation state of the user operation is the change of the gesture state, determining that the user operation is the gesture operation, and monitoring the gesture operation for triggering exiting of the current application interface.
Alternatively, the gesture operation may refer to a sliding operation performed by the user on the current application interface from left to right on the terminal screen.
The determining unit 602 is configured to determine that the exiting operation of the current application interface is an abnormal exiting operation if an operation of setting interface navigation information of the current application interface is monitored.
Alternatively, the interface navigation information may include name information of the current application interface and a button linked to the previous application interface or the home page.
The determining unit 602 may specifically be configured to:
judging whether the application program is the same as a preset application program or not;
and if the application program is different from the preset application program, determining that the exiting operation of the current application interface is an abnormal exiting operation.
It should be noted that the function of the above-mentioned determining unit 601 may be implemented by the interface monitor 301, the navigation bar monitor 302, and the active filter 303 in fig. 3, and the function of the determining unit 602 may be implemented by the active filter 303.
The functions of the functional modules of the device in the embodiment of the present application may be implemented through the steps in the method embodiment described above, and therefore, the specific working process of the device provided in the present application is not repeated herein.
According to the monitoring device for abnormal exit of the application interface of the application program, when the gesture operation triggering exit of the current application interface of the application program is monitored on the terminal screen, the judgment unit 601 judges whether the operation of setting the interface navigation information of the current application interface is monitored during the execution of the gesture operation; if the operation of setting the interface navigation information of the current application interface is monitored, the determining unit 602 determines that the exiting operation of the current application interface is an abnormal exiting operation. The method and the device can automatically monitor the exit operation of the application interface of the application program, so that the monitoring efficiency of the abnormal exit of the application interface of the application program can be improved.
It should be noted that the monitoring apparatus for abnormal exit of the application interface of the application program provided by the present application may be integrated into a client monitoring plug-in of the application program, for example, when the apparatus is used to determine whether the exit of the application interface of the "pay bank" is abnormal, the apparatus may be integrated into "FlyFox", where the "FlyFox" is used to monitor problems occurring when the "pay bank" client is running and provide a running tool to help determine the problems.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.