A method for a smart terminal to detect and monitor whether an APP has stopped running
Through the heartbeat connection between the smart terminal and the server and information calculation methods, the status detection problem of the monitoring APP when the network is unstable or shut down is solved, and data security is guaranteed.
Patent Information
- Application Number
- CN202210573767.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-05-25
AI Technical Summary
The prior art cannot effectively detect whether the monitoring APP on the smart terminal is stopped in the event of network blockage, flight mode or shutdown, resulting in an increase in the risk of data leakage.
The smart terminal maintains a heartbeat connection with the server, and uses the heartbeat information to judge the operating status of the APP, including determining the operating status of the APP by calculating the number and time differences of the heartbeat information when the network is unstable or shutdown, and using the IMEI or MAC address for user identification.
Even when the network is unstable or shutdown, it can accurately detect and monitor the operating status of the APP to avoid data leakage and ensure data security.
Smart Images

Figure CN115048262B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of IT and software development. Specifically, it relates to a method for an intelligent terminal to detect whether a monitoring APP has been stopped from running. Background Art
[0002] In some security agencies such as military agencies, research institutes, etc., it is required that an intelligent terminal must install a certain monitoring APP. However, for some reasons, the end user may stop the running of this monitoring APP and then restart the monitoring APP after performing a certain operation. Therefore, the administrator needs to master such information for further review. Therefore, it is very necessary to detect whether the monitoring APP on the intelligent terminal has been stopped from running.
[0003] Mostly, whether the monitoring APP has stopped running is judged through a heartbeat mechanism. However, the existing technologies all use the interruption of heartbeat data transmission to judge that the terminal program is disconnected from the network or stopped. In the case of network disconnection, flight mode, normal shutdown, and restart, the heartbeat mechanism cannot be maintained, and it is impossible to judge whether the monitoring APP has been stopped from running in the above situations. Summary of the Invention
[0004] In view of this, the present invention provides a method for an intelligent terminal to detect whether a monitoring APP has been stopped from running, which can detect whether the monitoring APP on the intelligent terminal has been stopped from running, thereby avoiding the risk of data leakage caused during the period when the monitoring APP is stopped from running, and further ensuring data security.
[0005] To achieve the above technical purpose, the present invention adopts the following technical solution: A method for an intelligent terminal to detect whether a monitoring APP has been stopped from running, where the intelligent terminal is communicatively connected to a server, and specifically includes the following steps:
[0006] Step S210: During the running of the monitoring APP on the intelligent terminal, the intelligent terminal and the server maintain a heartbeat.
[0007] Step S220: The server determines whether the monitoring APP on the intelligent terminal has been stopped from running according to the heartbeat information.
[0008] Further, the monitoring APP is set to automatically run when the intelligent terminal is powered on.
[0009] Further, the specific process of step S201 is as follows: During the running of the monitoring APP on the intelligent terminal, the intelligent terminal sends a heartbeat information to the server at intervals of a preset time. The monitoring APP stores the number of times of sending the heartbeat information on the intelligent terminal, and the server stores the information carried by the heartbeat information.
[0010] Further, the heartbeat information carries the username, the International Mobile Equipment Identity (IMEI), and the number of times the smart terminal sends the heartbeat information.
[0011] Further, in step S220, if the server continuously receives the heartbeat information, it indicates that the running status of the monitoring APP is normal and the monitoring APP has not been stopped.
[0012] Further, in step S220, if the smart terminal terminates the operation of the monitoring APP for a time exceeding the allowed stop time and then restarts the monitoring APP, the number of heartbeat messages sent by the smart terminal to the server only increases by 1. After receiving this heartbeat information, the server determines that the monitoring APP has been abnormally terminated and issues an alarm.
[0013] Further, in step S220, if the smart terminal is in airplane mode or an environment with no network connection, after the server fails to receive the heartbeat information sent by the monitoring APP, the monitoring APP automatically increments the number of times it sends the heartbeat information according to the preset heartbeat information duration. After the network returns to normal, it sends the latest number of times of the heartbeat information to the server. After the server receives the latest heartbeat message, it calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the previous heartbeat information reception time. If the error is less than the threshold, it is considered that the running status of the monitoring APP is normal and the monitoring APP has not been stopped; otherwise, it is considered that the monitoring APP has been stopped.
[0014] Further, in step S220, if the user shuts down the device actively or the device shuts down automatically due to exhausted battery, the monitoring APP needs to detect the shutdown signal of the smart terminal and record the shutdown time locally. After the smart terminal is powered on, the monitoring APP obtains the previous shutdown time from local storage and calculates the latest number of the heartbeat information based on the current time. The smart terminal sends the latest number to the server. After the server calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the previous heartbeat information reception time. If the error is less than the threshold, it is considered that the running status of the monitoring APP is normal and the monitoring APP has not been stopped; otherwise, it is considered that the monitoring APP has been stopped.
[0015] Further, the calculation process of the latest number of the heartbeat information is as follows:
[0016] The latest number of the heartbeat information = the number of the previously recorded heartbeat information + (the current time - the shutdown time) / the heartbeat duration.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention judges through heartbeat information, so as to obtain the situation of whether the monitoring APP has stopped. Moreover, even when the network is not connected, the flight mode is on, the device is normally shut down or restarted, although the heartbeat mechanism cannot be maintained, the method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention can detect whether the monitoring APP is running properly through the processing of the intelligent terminal and the server, avoiding the leakage of data during the period when the monitoring APP stops running, and thus being able to ensure data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 FIG. is a schematic diagram of an application scenario of the method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention;
[0019] Figure 2 FIG. is a flowchart of the method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention;
[0020] Figure 3 FIG. is a schematic diagram of the security center connected to the server for alarm. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] The technical solution of the present invention will be further explained below with reference to the accompanying drawings.
[0022] As Figure 1 FIG. is a schematic diagram of an application scenario of the method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention. The application scenario includes: an intelligent terminal 110 and a server 120, and a communication connection is maintained between the intelligent terminal 110 and the server 120 to provide guarantee for the subsequent regular sending of heartbeat messages; at the same time, the monitoring APP is set to run automatically when the intelligent terminal 110 is powered on. If it does not run automatically, during the period from when the device is powered on to when the monitoring APP runs, it is impossible to judge whether the monitoring APP is running, affecting the monitoring quality of the monitoring APP.
[0023] As Figure 2 FIG. is a flowchart of the method for the intelligent terminal to detect and monitor whether the monitoring APP has stopped running according to the present invention, specifically including the following steps:
[0024] Step S210: During the operation of the monitoring APP on the intelligent terminal 110, the intelligent terminal 110 and the server 120 maintain a heartbeat to determine whether the monitoring APP has been stopped. Specifically, during the operation of the monitoring APP on the intelligent terminal 110, the intelligent terminal 110 sends a heartbeat message to the server 120 at preset intervals. The monitoring APP stores the number of times the heartbeat message is sent on the intelligent terminal 110, and the server 120 stores the information carried by the heartbeat message. The server 120 determines whether the monitoring APP has been stopped according to the number of times the heartbeat message is stored. In the present invention, the heartbeat message carries the user name, International Mobile Equipment Identification Number (IMEI), and the number of times the intelligent terminal 110 sends the heartbeat message, and the corresponding user can be found through this heartbeat message.
[0025] Step S220: The server 120 determines whether the monitoring APP on the intelligent terminal 110 has been stopped according to the heartbeat message; specifically:
[0026] If the server 120 continuously receives heartbeat messages, the running state of the monitoring APP is normal, and the monitoring APP has not been stopped.
[0027] If the intelligent terminal 110 is in flight mode or an environment with poor network connection, after the server 120 fails to receive the heartbeat message sent by the monitoring APP, the monitoring APP automatically increments the number of times the heartbeat message is sent according to the preset duration of the heartbeat message, and after the network returns to normal, sends the number of times of the latest heartbeat message to the server 120; after the server 120 receives the latest heartbeat message, calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the previous heartbeat message reception time for error. If the error is less than the threshold, it is considered that the running state of the monitoring APP is normal and the monitoring APP has not been stopped; otherwise, it is considered that the monitoring APP has been stopped. The present invention considers reasons such as network latency and time asynchronization, and as long as the error is within the set threshold range, it is considered that the monitoring APP is running normally.
[0028] If the intelligent terminal 110 terminates the operation of the monitoring APP for more than the allowed stop time and then runs the monitoring APP again, the number of times the heartbeat message sent by the intelligent terminal 110 to the server 120 only increases by 1. After the server 120 receives this heartbeat message, it determines that the monitoring APP has been abnormally terminated and issues an alarm. The above alarm method can be for the server 120 to alarm itself, or by Figure 3The security center connected to the server 120 as shown issues an alarm. When an alarm needs to be issued, the server 120 sends an alarm message to the security center to indicate which monitoring APP of the intelligent terminal has been stopped, so that relevant personnel can investigate the person who stopped the monitoring APP based on the alarm message, discover problems in a timely manner and solve them, thereby minimizing risks.
[0029] If the user shuts down the device actively or the device shuts down automatically due to battery exhaustion, the monitoring APP needs to detect the shutdown signal of the intelligent terminal 110 and record the shutdown time locally; after the intelligent terminal 110 is powered on, the monitoring APP obtains the last shutdown time from the local device and calculates the latest number of heartbeat messages based on the current time:
[0030] The latest number of heartbeat messages = the number of heartbeat messages recorded last time + (current time - shutdown time) / heartbeat duration
[0031] The intelligent terminal 110 sends the latest number to the server 120. The server 120 calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the receiving time of the previous heartbeat message for error. If the error is less than the threshold, it is considered that the running state of the monitoring APP is normal and the monitoring APP has not been stopped; otherwise, it is considered that the monitoring APP has been stopped.
[0032] It should be noted here that although the above description is based on IMEI, those skilled in the art should understand that it can also replace IMEI with the MAC address.
[0033] The method of the present invention for detecting whether the monitoring APP on the intelligent terminal has been stopped can detect whether the monitoring APP on the intelligent terminal has been stopped. Even when the network is not connected, in airplane mode, during normal shutdown or restart, although the heartbeat mechanism cannot be maintained, the method of the present invention for detecting whether the monitoring APP on the intelligent terminal has been stopped can detect whether the monitoring APP has been stopped from normal operation through the processing of the intelligent terminal and the server, thereby avoiding the situation of data leakage during the period when the monitoring APP is stopped, and further ensuring data security.
[0034] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. All technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for those of ordinary skill in the art, several improvements and refinements made without departing from the principle of the present invention should be regarded as within the protection scope of the present invention.
Claims
1. A method for a smart terminal to detect and monitor whether an APP has stopped running, characterized in that, The intelligent terminal (110) is communicatively connected to the server (120), and specifically includes the following steps: Step S210: During the operation of the monitoring APP on the intelligent terminal (110), the intelligent terminal (110) and the server (120) maintain a heartbeat; the specific process is as follows: During the operation of the monitoring APP on the intelligent terminal (110), the intelligent terminal (110) sends a heartbeat message to the server (120) at intervals of a preset time. The monitoring APP stores the number of times the heartbeat message is sent on the intelligent terminal (110), and the server (120) stores the information carried by the heartbeat message. Step S220: The server (120) determines whether the monitoring APP on the intelligent terminal (110) has been stopped from running according to the heartbeat message. Specifically: If the server (120) continuously receives the heartbeat message, the running state of the monitoring APP is normal, and the monitoring APP has not been stopped from running. If the intelligent terminal (110) terminates the operation of the monitoring APP for a time exceeding the allowed stop time and then runs the monitoring APP again, the number of heartbeat messages sent by the intelligent terminal (110) to the server (120) only increases by 1. After receiving this heartbeat message, the server (120) determines that the monitoring APP has been abnormally terminated and issues an alarm. If the intelligent terminal (110) is in airplane mode or an environment with no network connection, after the server (120) fails to receive the heartbeat message sent by the monitoring APP, the monitoring APP automatically increments the number of times the heartbeat message is sent according to the duration of the preset heartbeat message, and after the network returns to normal, sends the number of the latest heartbeat message to the server (120); after the server (120) receives the latest heartbeat message, it calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the reception time of the previous heartbeat message. If the error is less than the threshold, it is considered that the running state of the monitoring APP is normal and the monitoring APP has not been stopped from running. Otherwise, it is considered that the monitoring APP has been stopped from running. If the user actively shuts down the device or the device shuts down automatically due to exhausted battery, the monitoring APP needs to detect the shutdown signal of the intelligent terminal (110) and record the shutdown time locally; after the intelligent terminal (110) is powered on, the monitoring APP obtains the previous shutdown time from local storage and calculates the latest number of heartbeat messages according to the current time. The intelligent terminal (110) sends the latest number to the server (120). The server (120) calculates the product of the increment of the number of heartbeat messages and the heartbeat duration, and compares the product value with the reception time of the previous heartbeat message. If the error is less than the threshold, it is considered that the running state of the monitoring APP is normal and the monitoring APP has not been stopped from running. Otherwise, it is considered that the monitoring APP has been stopped from running.
2. The method for detecting and monitoring whether the intelligent terminal detection and monitoring APP is stopped according to claim 1, wherein, The monitoring APP is set to automatically run when the intelligent terminal (110) is powered on.
3. The method for detecting and monitoring whether the intelligent terminal detection and monitoring APP is stopped according to claim 1, characterized in that, The heartbeat message carries the user name, the international mobile equipment identification number, and the number of times the intelligent terminal (110) sends the heartbeat message.
4. The method for detecting and monitoring whether the intelligent terminal detection and monitoring APP is stopped according to claim 1, wherein, The calculation process of the latest number of the heartbeat message is as follows: The latest count of heartbeat information = the count of the last recorded heartbeat information + (the current time - the shutdown time) / the heartbeat duration.
Citation Information
Patent Citations
Fault detection method and server
CN112671603A
Low-delay terminal state detection method, storage medium and system
CN113411237A