Terminal floating window detection method, system and device and medium
By detecting the type of floating windows in the Android system and controlling them, the resource consumption and information leakage problems caused by the random use of floating windows are solved, and effective management and security guarantees for the use of floating windows are achieved.
Patent Information
- Application Number
- CN202510127873.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-02-05
AI Technical Summary
In the prior art, the random use of floating windows in the Android system leads to resource consumption and potential information leakage hazards, and lacks systematic detection and allocation measures.
It provides a method for detecting terminal floating windows, which determines the type of floating windows and detects them by obtaining touch events and identification information, thereby controlling the use of floating windows to avoid resource consumption and information leakage.
The detection of many different types of floating windows is achieved, with a wide coverage range, which can reflect users' usage habits, and by controlling the use of floating windows, it avoids resource consumption and information leakage hazards.
Smart Images

Figure CN119556820A_ABST
Abstract
Description
Background Art
[0002] In recent years, the operational page design of Android system has gradually diversified, and more and more personalized floating windows help users solve various problems, such as prompts, auxiliary viewing, watching videos, and video and voice communication with others. Different APP applications design different floating windows according to their own APPs, and there are many types. The random use of floating windows will seriously affect the system performance and occupy system resource space. At the same time, the use of floating windows may lead to excessive use of resources or data and information leakage between APPs.
[0003] At present, the existing solutions for detecting and controlling Android floating windows are only implemented within each APP to check whether the user has the permission to open the floating window of his own APP, and there is no systematic detection, deployment and processing of Android floating windows. Summary of the invention
[0004] The technical problem to be solved by the present invention is to address the deficiencies of the prior art, specifically to address the problem of resource consumption caused by the random use of floating windows, and specifically to provide a terminal floating window detection method, system, device and medium, as follows: 1) In a first aspect, the present invention provides a method for detecting a floating window of a terminal, and the specific technical solution is as follows: When a user of the terminal to be detected generates a touch action, a touch event is acquired; a floating window feature value of the terminal to be detected is determined according to the touch event, and a floating window type of the terminal to be detected is determined according to the floating window feature value; The identification information of the terminal to be detected is obtained, and a floating window detection result of the terminal to be detected is determined according to the identification information and the floating window type.
[0005] The beneficial effects of the terminal floating window detection method provided by the present invention are as follows: By analyzing the floating window feature values of the terminal to be detected, the corresponding floating window type is obtained, and various types of floating windows can be detected, with a wide detection coverage. The floating window detection result of the terminal to be detected is determined based on the terminal identification information and the floating window type analysis, and the floating window detection result is combined with the identification information of the terminal to be detected, which can reflect the user's usage habits of the floating window of the terminal to be detected. At the same time, the floating window can also be controlled according to the floating window detection result, avoiding problems such as resource consumption and potential information leakage caused by the arbitrary use of floating windows.
[0006] Based on the above solution, the present invention can also be improved as follows.
[0007] Furthermore, the floating window types include: Any of the following types: no floating window type, semi-blocked floating window type, and regional floating window type.
[0008] Furthermore, the identification information includes: At least one of the terminal identification of the terminal to be detected, the running APP identification of the terminal to be detected, or the user information of the terminal to be detected.
[0009] Further, the determining the floating window detection result of the terminal to be detected according to the identification information and the floating window type further includes: Determine a floating window detection result of the terminal to be detected according to the number of floating window displays, the identification information, and the floating window type; Wherein, a display service of the terminal to be detected is obtained, and the number of floating window displays is determined according to the display service.
[0010] 2) In a second aspect, the present invention further provides a terminal floating window detection system, and the specific technical solution is as follows: comprising: a floating window type module and a floating window detection module; The floating window type module is used to obtain a touch event when a user of the terminal to be detected generates a touch behavior; determine a floating window feature value of the terminal to be detected according to the touch event, and determine a floating window type of the terminal to be detected according to the floating window feature value; The floating window detection module is used to obtain the identification information of the terminal to be detected, and determine the floating window detection result of the terminal to be detected according to the identification information and the floating window type.
[0011] Based on the above solution, the present invention can also be improved as follows.
[0012] Furthermore, the floating window types include: Any of the following types: no floating window type, semi-blocked floating window type, and regional floating window type.
[0013] Furthermore, the identification information includes: At least one of the terminal identification of the terminal to be detected, the running APP identification of the terminal to be detected, or the user information of the terminal to be detected.
[0014] Further, the determining the floating window detection result of the terminal to be detected according to the identification information and the floating window type further includes: Determine a floating window detection result of the terminal to be detected according to the number of floating window displays, the identification information, and the floating window type; Wherein, a display service of the terminal to be detected is obtained, and the number of floating window displays is determined according to the display service.
[0015] 3) In a third aspect, the present invention further provides a computer device, comprising a processor, wherein the processor is coupled to a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the computer device implements any of the above methods.
[0016] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above methods.
[0017] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A schematic diagram of the steps of a method for detecting a floating window on a terminal according to an embodiment of the present invention; Figure 2 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0020] like Figure 1 As shown, a terminal floating window detection method according to an embodiment of the present invention includes the following steps: S1, when a user of the terminal to be detected generates a touch behavior, a touch event is obtained; a floating window feature value of the terminal to be detected is determined according to the touch event, and a floating window type of the terminal to be detected is determined according to the floating window feature value; S2, obtaining identification information of the terminal to be detected, and determining a floating window detection result of the terminal to be detected according to the identification information and the floating window type.
[0021] The beneficial effects of the terminal floating window detection method provided by the present invention are as follows: By analyzing the floating window feature values of the terminal to be detected, the corresponding floating window type is obtained, and various types of floating windows can be detected, with a wide detection coverage. The floating window detection result of the terminal to be detected is determined based on the terminal identification information and the floating window type analysis. The floating window detection result is combined with the identification information of the terminal to be detected, which can reflect the user's usage habits of the floating window of the terminal to be detected. At the same time, the floating window can also be controlled according to the floating window detection result, avoiding problems such as resource consumption and potential information leakage caused by the arbitrary use of floating windows.
[0022] Embodiment 1: S1, when the user of the terminal to be detected generates a touch behavior, a touch event is obtained; a floating window feature value of the terminal to be detected is determined according to the touch event, and a floating window type of the terminal to be detected is determined according to the floating window feature value. The terminals to be tested refer to: mobile phones with touch screens, Android smart tablets, smart system game consoles with touch screens, etc.
[0023] The touch behavior refers to the behavior of a user touching the screen of the terminal to be detected to control the terminal.
[0024] Touch events refer to touch events of the terminal to be detected when the user performs touch actions. For example, in the terminal to be detected using the Android system, the dispatchTouchEvent method in the Activity class of the Android UI page can be rewritten as follows: public boolean dispatchTouchEvent(MotionEvent event); Among them, MotionEvent event represents a touch event, and the MotionEvent class is used to handle user input events, such as touching the screen, sliding, etc.
[0025] In the dispatchTouchEvent method, get the flag value through the getFlags method of the event parameter and save it in a floatType memory variable, as follows: public boolean dispatchTouchEvent(MotionEvent event) { floatType = event.getFlags(); return super.dispatchTouchEvent(event); }; Among them, the flag value obtained by the getFlags method of the parameter event is the floating window feature value.
[0026] The process of determining the floating window type of the terminal to be detected according to the floating window characteristic value is: comparing the floating window characteristic value with a preset value to determine the floating window type.
[0027] Further, in another embodiment of the present invention, the floating window type includes: any one of a non-floating window type, a semi-blocked floating window type, and a regional floating window type. The non-floating window type refers to: the type of the terminal to be detected without a floating window, in which case the floating window characteristic value is a first preset value; The semi-blocked floating window type refers to: a floating window exists on the terminal to be detected, and the width of the floating window is equal to the width of the terminal screen to be detected or the length of the floating window is equal to the length of the terminal screen to be detected, and the floating window is located on one side of the terminal screen to be detected. For example, if a mobile phone has a floating window, the width of the floating window is equal to the width of the mobile phone screen, and the floating window is located at the bottom of the mobile phone screen, then the floating window belongs to the semi-blocked floating window type; at this time, the floating window characteristic value is the second preset value; For floating windows that exist in the terminal to be detected and are not semi-occluded floating window types, they are determined to be regional floating window types. Such floating windows can be circular, square, rectangular, or irregular in structure; for example: Tencent conference shared desktop, WeChat video window, Douyin video window, etc.; at this time, the floating window characteristic value is the third preset value.
[0028] It should be noted that the first preset value, the second preset value and the third preset value are fixed values, which are specifically set according to the type of operating system applied by the terminal to be detected.
[0029] According to the above three types of judgment, the code process is as follows: Determine whether there is no floating window: public boolean isNoFloatWindow() { return floatType == 0; }.
[0030] Determine whether it is a semi-occluded floating window: public boolean isAreaFloatWindow() { return floatType == MotionEvent.FLAG_WINDOW_IS_OBSCURED; }; Among them, MotionEvent.FLAG_WINDOW_IS_OBSCURED is the second preset value.
[0031] Determine whether it is a regional floating window type, such as: Tencent conference shared desktop, WeChat video window, Douyin video window: public boolean isBlockFloatWindow() { return floatType == MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED; }; Among them, MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED represents the third preset value.
[0032] S2, obtaining identification information of the terminal to be detected, and determining the floating window detection result of the terminal to be detected according to the identification information and the floating window type. The identification information refers to: a character string, a variable or an object, etc. that can represent the identity information of the terminal to be detected.
[0033] In another embodiment of the present invention, the identification information includes at least one of: a terminal identification of the terminal to be detected, an identification of an APP running on the terminal to be detected, or user information of the terminal to be detected. The terminal identifier of the terminal to be detected may be: a serial code of a mobile phone, a serial code of a game console, etc.
[0034] Running APP refers to: the currently running APP or the APP involved in the touch event. For example, if the WeChat video window is currently being used, APP refers to the current WeChat.
[0035] APP identification refers to: APP serial code, APP name, APP version number and other information, which constitute the APP identification, for example: WeChat, wechat v2.1.
[0036] The user information of the terminal to be detected may be: the user name and user ID logged in in the APP, etc.
[0037] Based on the identification information and the floating window type, the current floating window situation of the device to be tested can be determined. For example: the device to be tested is a smart phone, the current user logs in to WeChat and uses the WeChat video widget. The serial code of the smart phone, WeChat version, user's name and ID, and the floating window type are obtained. The floating window type is a regional floating window type. It can be known that the device to be tested currently has a floating window, which is a WeChat video widget.
[0038] Further, in another embodiment of the present invention, determining the floating window detection result of the terminal to be detected according to the identification information and the floating window type also includes: determining the floating window detection result of the terminal to be detected according to the floating window display quantity, identification information and floating window type; wherein, obtaining the display service of the terminal to be detected, and determining the floating window display quantity according to the display service. The number of floating window displays refers to the number of floating windows currently being displayed. For example, in an Android system terminal to be detected, the display service of the terminal to be detected can be obtained, and the floating window display data can be determined according to the method in the display service, as follows: public boolean isCastWindow() { Display[] displays = displayManager.getDisplays(); return displays.length>1; }; Among them, displayManager represents the display service, getDisplays() represents the method of obtaining the number of displays; according to the obtained number of displays, the floating window display data is determined. The floating window display data can be: whether the screen is currently being projected, or the screen is shared in Tencent Conference, which can determine whether the terminal to be detected has shared screen or projected screen, etc., avoiding the problem of inaccurate floating window detection caused by sharing or projecting the local terminal to be detected, thereby overcoming the difficulty of resource consumption caused by random use of floating windows.
[0039] Furthermore, in another embodiment of the present invention, user information may be collected, and the user information and the floating window type may be reported to the server of the terminal to be detected to analyze the user's usage and operation habits.
[0040] The benefits of adopting the above solution are: The present invention provides effective floating window detection results. It covers various types of Android floating windows: semi-occluded floating windows (such as card recorders), regional floating windows such as conference APP shared desktops, WeChat voice and video floating windows, or video application floating windows (TikTok floating windows), etc., and the detection results are accurate. It creatively classifies floating windows by type, collects user information and floating window information and reports them to the server, which performs data analysis and generates user portraits.
[0041] Embodiment 2: According to the method and steps in the above solution, this embodiment lists a step for detecting the type of a semi-occluded floating window, as follows: 1. Intercept the dispatchTouchEvent method in the terminal page to obtain the touch event event; 2. Call event.getFlags() to get the feature value flag and save it as floatType; 3. Analyze floatTyp and MotionEvent.FLAG_WINDOW_IS_OBSCURED to find out whether a semi-occluded floating window (such as a card counter) exists; 4. Collect user and device information and report it to the server, which performs data analysis and generates user portraits.
[0042] Embodiment three: According to the method and steps in the above solution, this embodiment lists a method for implementing the detection of a transparent floating window of a conference application belonging to a regional floating window type, as follows: 1. Intercept the dispatchTouchEvent method in the terminal page to obtain the touch event event; 2. Call event.getFlag() to get the feature value flag and record it as floatType; 3. Analysis of floatType and MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED shows that the user is using a regional floating window, such as a conference application that is sharing the screen; 4. Collect user and device information and report it to the server, which performs data analysis and generates user portraits.
[0043] The transparent floating window refers to a floating window that can be hidden on the terminal screen without displaying the content in the floating window, and can be awakened by user operation to expand the floating window content when needed.
[0044] Embodiment 4: According to the method and steps in the above solution, this embodiment lists a step for implementing screen projection detection as follows: 1. Call DisplayManager.getDisplays(); 2. Record the number of screen windows of the diplays player's device and compare whether it is greater than 1. If so, the user uses screen projection; 3. Collect user and device information and report it to the server, which will perform data analysis and generate user portraits.
[0045] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0046] The present invention also provides a terminal floating window detection system, and the specific technical solution is as follows: comprising: a floating window type module and a floating window detection module; The floating window type module is used to obtain a touch event when a user of the terminal to be detected generates a touch behavior; determine a floating window feature value of the terminal to be detected according to the touch event, and determine a floating window type of the terminal to be detected according to the floating window feature value; The floating window detection module is used to obtain the identification information of the terminal to be detected, and determine the floating window detection result of the terminal to be detected according to the identification information and the floating window type.
[0047] Furthermore, the floating window types include: Any of the following types: no floating window type, semi-blocked floating window type, and regional floating window type.
[0048] Furthermore, the identification information includes: At least one of a terminal identifier of the terminal to be detected, an identifier of an APP running on the terminal to be detected, or user information of the terminal to be detected.
[0049] Further, determining the floating window detection result of the terminal to be detected according to the identification information and the floating window type also includes: Determine the floating window detection result of the terminal to be detected according to the floating window display quantity, identification information and floating window type; Among them, the display service of the terminal to be detected is obtained, and the number of floating window displays is determined according to the display service.
[0050] It should be noted that the beneficial effects of the terminal floating window detection system provided by the above embodiment are the same as the beneficial effects of the terminal floating window detection method provided by the above embodiment, which will not be repeated here. In addition, when the system provided by the above embodiment realizes its functions, it only takes the division of the above functional modules as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system is divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided by the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0051] like Figure 2 As shown, a computer device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the computer device 300 implements any of the above methods, specifically: The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the computer device 300 implements a terminal floating window detection method provided by the above embodiment. Of course, the computer device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device 300 may also include other components for implementing device functions, which will not be repeated here.
[0052] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above methods.
[0053] Optionally, the computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0054] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above-mentioned terminal floating window detection methods.
[0055] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0056] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0057] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A terminal floating window detection method, characterized in that: include: When a user of the terminal to be detected generates a touch action, a touch event is acquired; a floating window feature value of the terminal to be detected is determined according to the touch event, and a floating window type of the terminal to be detected is determined according to the floating window feature value; The identification information of the terminal to be detected is obtained, and a floating window detection result of the terminal to be detected is determined according to the identification information and the floating window type.
2. A terminal floating window detection method according to claim 1, characterized in that: The floating window types include: Any of the following types: no floating window type, semi-blocked floating window type, and regional floating window type.
3. The method for detecting a terminal floating window according to claim 1, characterized in that: The identification information includes: At least one of the terminal identification of the terminal to be detected, the running APP identification of the terminal to be detected, or the user information of the terminal to be detected.
4. The method for detecting a terminal floating window according to claim 1, characterized in that: The determining, according to the identification information and the floating window type, a floating window detection result of the terminal to be detected further includes: Determine a floating window detection result of the terminal to be detected according to the number of floating window displays, the identification information, and the floating window type; Wherein, a display service of the terminal to be detected is obtained, and the number of floating window displays is determined according to the display service.
5. A terminal floating window detection system, characterized in that: include: Floating window type module and floating window detection module; The floating window type module is used to obtain a touch event when a user of the terminal to be detected generates a touch action; Determine a floating window feature value of the terminal to be detected according to the touch event, and determine a floating window type of the terminal to be detected according to the floating window feature value; The floating window detection module is used to obtain the identification information of the terminal to be detected, and determine the floating window detection result of the terminal to be detected according to the identification information and the floating window type.
6. A terminal floating window detection system according to claim 5, characterized in that: The floating window types include: Any of the following types: no floating window type, semi-blocked floating window type, and regional floating window type.
7. A terminal floating window detection system according to claim 5, characterized in that: The identification information includes: At least one of the terminal identification of the terminal to be detected, the running APP identification of the terminal to be detected, or the user information of the terminal to be detected.
8. The terminal floating window detection system according to claim 5, characterized in that: The determining, according to the identification information and the floating window type, a floating window detection result of the terminal to be detected further includes: Determine a floating window detection result of the terminal to be detected according to the number of floating window displays, the identification information, and the floating window type; Wherein, a display service of the terminal to be detected is obtained, and the number of floating window displays is determined according to the display service.
9. A computer device, characterized in that: The computer device comprises a processor, the processor is coupled to a memory, the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the computer device implements the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Floating window display method and device, electronic equipment and readable storage medium
CN113176841A
Display method and electronic equipment
CN114911390A
Display device and floating window display method
CN117406886A
Method, device, and storage medium for controlling display of floating window
US20210333948A1
Application switching method, graphical interface, and related apparatus
US20240061549A1