Display component control method, apparatus, device, storage medium, and program product

By listening to and judging the trigger source of the display component, the startup of the display component that is not triggered by the user is prohibited, which solves the problem of the display content being obscured by malicious applications in the Android system and realizes the normality and security of the user's page browsing.

CN115270208BActive Publication Date: 2026-02-10DAWNING INT INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210812413.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2026-02-10
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

In the Android system, some malicious applications can start at any time through background services, covering or obscuring the interactive display interface of the user's current browsing operation, causing the user to be unable to browse the page normally, or even causing property damage or system damage.

Method used

By listening to the display component to be launched, we can obtain its trigger source and determine whether it is triggered by the user. If it is not triggered by the user, we can prevent the display component from starting and keep the current display component's page display.

Benefits of technology

It effectively prevents the display components from starting without user intervention, ensuring normal page browsing for users and protecting user assets and system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115270208B_ABST
    Figure CN115270208B_ABST
Patent Text Reader

Abstract

The application relates to a display component control method, device, equipment, storage medium and program product. The method comprises the following steps: after listening to a first display component to be started being triggered, acquiring a trigger source corresponding to the first display component; detecting whether the first display component is triggered by a user autonomously according to the trigger source; if the first display component is not triggered by the user autonomously, the first display component is prohibited from being started, and a second display component currently displayed by a page is kept. By using the method, the application and the display component started by the non-user active behavior can be shielded, the normal page browsing of the user is ensured, and the property and system safety of the user are protected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a display component control method, apparatus, device, storage medium, and program product. Background Technology

[0002] As the market share of Android continues to increase year by year, the number of applications based on Android has also exploded. An Activity in Android refers to a human-computer interaction interface that fills the entire window or floats on top of other windows; the application's interface display is mainly managed through Activities.

[0003] Currently, regarding the display content on the Android system, some malicious applications can start at any time through background services. This can cover or obscure the interactive display interface that the user is currently browsing, preventing the user from browsing the page normally. Alternatively, some malicious applications can start at any time through background services and disguise themselves as the interactive display interface that the user is currently browsing, thereby causing financial losses or system damage to the user.

[0004] Given the problems mentioned above, there is an urgent need for a method to control the displayed content on the Android system. Summary of the Invention

[0005] Therefore, it is necessary to provide a display component control method, device, equipment, storage medium, and program product that can block non-user-initiated behavior in launching applications and display components, ensure normal page browsing for users, and protect users' property and system security, in order to address the above-mentioned technical problems.

[0006] In a first aspect, this application provides a display component control method, the method comprising:

[0007] After detecting that the first display component to be launched has been triggered, obtain the trigger source corresponding to the first display component;

[0008] Based on the above trigger source detection, determine whether the first display component is triggered by the user.

[0009] If the first display component is not triggered by the user, then the first display component should be disabled from starting, and the page should continue to display the currently displayed second display component.

[0010] In this embodiment, since the trigger source of the display component to be started can be detected as to whether it is triggered by the user, and the start of the display component is prohibited when it is not triggered by the user, the start of display components not actively triggered by the user can be prohibited or blocked, maintaining the original display components on the page, thereby ensuring normal page browsing for the user and reducing harassment to the user; at the same time, prohibiting or blocking the start of display components not actively triggered by the user will not affect the user's property or system, thereby ensuring the security of the user's property and system.

[0011] In one embodiment, obtaining the trigger source corresponding to the first display component includes:

[0012] Get the package name of the first application where the first display component is triggered, and get the package name of the second application where the second display component is located;

[0013] The above-mentioned detection of whether the first display component is triggered by the user includes:

[0014] Based on the consistency of the package name of the first application and the package name of the second application, it is determined whether the first display component is triggered by the user.

[0015] In this embodiment, by comparing the package name of the application where the first display component is located with the package name of the application where the second display component is located, and determining whether the first display component is triggered by the user based on the consistency comparison result, it is easy to quickly know whether the triggering behavior of the first display component is related to the user, so as to quickly proceed with the subsequent display component control process and improve the efficiency of display component control.

[0016] In one embodiment, determining whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application includes:

[0017] If the package name of the first application is the same as that of the second application, then the first display component is determined to be triggered by the user.

[0018] If the package name of the first application is different from that of the second application, then the first display component is determined to be non-user-triggered.

[0019] In this embodiment, the first display component is determined to be user-triggered when the package names are consistent, and not user-triggered when the package names are inconsistent. This can accurately determine the triggering behavior of the first display component and improve the accuracy of judging the triggering behavior of the first display component.

[0020] In one embodiment, before detecting whether the first display component was triggered by the user based on the trigger source, the method further includes:

[0021] Get the package name of the second application where the second display component is located;

[0022] Detect whether the package name of the second application is in a preset first listening list; the first listening list includes the package name of at least one application being monitored;

[0023] If the package name of the second application is not in the first listener list, then the first display component is allowed to start; or, if the package name of the second application is in the first listener list, then return to the above steps of detecting whether the first display component was triggered by the user based on the trigger source.

[0024] In this embodiment, by detecting whether the package name of the application in which the second display component is located is in the first listening list, and allowing the first display component to start when the application's package name is not in the first listening list, display components that do not belong to the monitored application can be started, thus meeting actual needs and reducing the power consumption of the monitoring.

[0025] In one embodiment, before detecting whether the first display component was triggered by the user based on the trigger source, the method further includes:

[0026] Get the package name of the first application containing the first display component;

[0027] Detect whether the package name of the first application is in a preset second listening list; the second listening list includes the package name of at least one application being monitored;

[0028] If the package name of the first application is not in the second listener list, then the first display component is allowed to start; or, if the package name of the first application is in the second listener list, then return to the above steps of detecting whether the first display component was triggered by the user.

[0029] In this embodiment, by determining whether the package name of the application containing the first display component is in the second listener list in the first listener list, and continuing to detect whether the first display component is triggered by the user when it is not in the listener list, the control over the startup of the first display component is more precise, thereby improving the accuracy of controlling the first display component.

[0030] In one embodiment, before detecting whether the first display component was triggered by the user based on the trigger source, the method further includes:

[0031] Detect whether the first display component belongs to the second application where the second display component is located;

[0032] If it does, then the first display component is allowed to start; otherwise, if it does not, then return to the above steps of detecting whether the first display component was triggered by the user based on the trigger source.

[0033] In this embodiment, by detecting whether the first display component belongs to the application where the second display component is located, and allowing the first display component to start when it does, the startup efficiency of the display component can be improved; in addition, when it does not belong, it is necessary to continue to detect whether the first display component was triggered by the user, which can improve the accuracy of detecting the startup of the first display component.

[0034] In one embodiment, the method further includes:

[0035] If the first display component is triggered by the user, then the first display component is allowed to start.

[0036] In this embodiment, the first display component is allowed to start when it is triggered by the user, which can meet the user's actual needs and improve the user experience.

[0037] In one embodiment, the first display component and the second display component are display components under the Android system.

[0038] In this embodiment, since both display components are components under the Android system, it is possible to control the display components under the Android system.

[0039] Secondly, this application also provides a display component control device, the device comprising:

[0040] The trigger source acquisition module is used to acquire the trigger source corresponding to the first display component after the first display component to be started is detected to be triggered.

[0041] The detection module is used to detect whether the first display component is triggered by the user based on the above trigger source;

[0042] The control module is used to prevent the first display component from starting if the first display component is not triggered by the user, and to keep the page displaying the currently displayed second display component.

[0043] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0044] After detecting that the first display component to be launched has been triggered, obtain the trigger source corresponding to the first display component;

[0045] Based on the above trigger source detection, determine whether the first display component is triggered by the user.

[0046] If the first display component is not triggered by the user, then the first display component should be disabled from starting, and the page should continue to display the currently displayed second display component.

[0047] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0048] After detecting that the first display component to be launched has been triggered, obtain the trigger source corresponding to the first display component;

[0049] Based on the above trigger source detection, determine whether the first display component is triggered by the user.

[0050] If the first display component is not triggered by the user, then the first display component should be disabled from starting, and the page should continue to display the currently displayed second display component.

[0051] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:

[0052] After detecting that the first display component to be launched has been triggered, obtain the trigger source corresponding to the first display component;

[0053] Based on the above trigger source detection, determine whether the first display component is triggered by the user.

[0054] If the first display component is not triggered by the user, then the first display component should be disabled from starting, and the page should continue to display the currently displayed second display component.

[0055] The aforementioned display component control method, apparatus, device, storage medium, and program product, after detecting that a first display component to be started has been triggered, obtains the trigger source corresponding to the first display component, and detects whether the first display component was triggered by the user. If it was not triggered by the user, the first display component is prevented from starting, and the page continues to display the currently displayed second display component. In this method, since the trigger source of the display component to be started can be detected as user-initiated, and the display component is prevented from starting if it is not user-initiated, the starting of display components not actively triggered by the user can be prohibited or blocked, maintaining the original display component on the page. This ensures normal page browsing for the user and reduces user harassment. Simultaneously, prohibiting or blocking the starting of display components not actively triggered by the user prevents the user's property or system from being affected, thus ensuring the security of user property and system. Attached Figure Description

[0056] Figure 1 This is an example of the Activity startup process in the prior art.

[0057] Figure 2 This is an internal structural diagram of a computer device in one embodiment;

[0058] Figure 3 This is a flowchart illustrating a component control method in one embodiment;

[0059] Figure 4 The launch process of an Activity with added monitoring in one embodiment;

[0060] Figure 5 This is a flowchart illustrating the component control method in another embodiment;

[0061] Figure 6 This is a flowchart illustrating the component control method in another embodiment;

[0062] Figure 7 This is a flowchart illustrating the component control method in another embodiment;

[0063] Figure 8 This is a flowchart illustrating the component control method in another embodiment;

[0064] Figure 9 This is a flowchart illustrating the component control method in another embodiment;

[0065] Figure 10 This is a structural block diagram of the component control device shown in one embodiment. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0067] Currently, regarding the displayed content on the Android system, some malicious applications can start at any time through background services. This can cover or obscure the interactive display interface that the user is currently browsing, preventing the user from browsing the page normally. Alternatively, some malicious applications can start at any time through background services and disguise themselves as the interactive display interface that the user is currently browsing, thereby causing financial losses or system damage to the user. Therefore, there is an urgent need for a method to control the displayed content on the Android system.

[0068] For the startup process of the display component in the existing Android system, please refer to [link / reference]. Figure 1 As shown, the display component here mainly refers to the Activity display component. An Activity is an application component that provides a screen that users can interact with to complete a task. All operations in an Activity are closely related to the user; it is a display component responsible for user interaction. A specific component can be displayed using `setContentView`. The specific startup process is as follows: After the Android system starts up, the application process requests to start the Activity. Then, Binder inter-process communication occurs. The Activity Manager Service receives the request to start the Activity, polls and executes the `onPause` method of the top Activity in the stack, and then starts the application process to which the Activity belongs.

[0069] As described above, in the current Android system, the startup process of the current Activity display component is to directly poll and execute the temporary termination method of the Activity display component at the top of the stack when the application process requests to start the Activity display component. That is, the Activity display component at the top of the stack is temporarily terminated, and the application process to which the current Activity display component belongs is started.

[0070] The display component control method provided in this application embodiment can be applied to computer devices, which can be terminals or servers. Taking a terminal as an example, the internal structure diagram of the computer device can be as follows: Figure 2 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a display component control method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0071] Those skilled in the art will understand that Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0072] In one embodiment, such as Figure 3 As shown, a display component control method is provided, which is applied to... Figure 1 Taking a computer device as an example, the method may include the following steps:

[0073] S202, after detecting that the first display component to be started has been triggered, obtain the trigger source corresponding to the first display component.

[0074] In this step, see Figure 4 The Activity display component startup process shown is as follows: Figure 1 Based on the existing startup process, this solution adds a listening process for the Activity display component before polling and executing the temporary termination method of the Activity display component at the top of the stack to start the application process to which the Activity display component belongs. Specifically: it checks whether Activity listening is enabled. If enabled, it injects the listening object into the existing startup process, i.e., injects the Activity display component to be listened to. Then, it executes the display component control strategy (i.e., subsequent control of the display of the listened Activity display component) and determines whether the listened Activity display component can be started. If it cannot be started, the process ends directly; if it can be started, it returns to executing the temporary termination method of the Activity display component at the top of the stack to start the application process to which the Activity display component belongs. Conversely, if it detects that listening is not enabled, it directly enters the existing startup process, i.e., polling and executing the temporary termination method of the Activity display component at the top of the stack to start the application process to which the Activity display component belongs, ultimately realizing the startup process for the Activity display component.

[0075] As described above, before controlling the display components, the computer device can listen to them. This listening process allows it to determine if any display components have been triggered to start. Here, the display component that is detected as being triggered to start is denoted as the first display component. It should be noted that this only indicates the first display component has been triggered to start; it has not yet actually started, remaining in a pending-start state. The first display component can be one or more.

[0076] Furthermore, after detecting that the first display component has been triggered, the trigger source can be obtained. The trigger source can be either user-initiated or non-user-initiated. User-initiated triggering refers to the user actively clicking or entering some commands to trigger the first display component to start. Non-user-initiated triggering refers to the first display component being triggered to start without any user action. This type of triggering may be malicious and therefore requires further processing.

[0077] S204, based on the above trigger source, detect whether the first display component is triggered by the user.

[0078] In this step, after obtaining the trigger source of the first display component, it is possible to determine whether the first display component was started by user intervention or by non-user intervention by judging the trigger source.

[0079] S206, if the first display component is not triggered by the user, then the first display component is prohibited from starting, and the page continues to display the currently displayed second display component.

[0080] In this step, after obtaining the trigger source determination result of the first display component, in one possible implementation, if the first display component is not initiated by the user, this triggering behavior may be malicious, potentially affecting the page currently being viewed by the user, or potentially impacting the user's property and system security. Therefore, it is necessary to prohibit the activation of the display component caused by this triggering behavior, i.e., to prohibit the activation of the first display component. Simultaneously, to ensure that the user's current browsing operation is not affected, the page being viewed by the user can be kept displaying the currently shown second display component. The second display component and the first display component are generally not the same component. However, optionally, both the first and second display components can be display components under the Android system, i.e., display components within the same system. This facilitates quick control of display components within the same system by the computer device.

[0081] In another possible implementation, optionally, if the first display component is triggered by the user, then the first display component is allowed to start. That is, if the first display component is actively triggered by the user, indicating that the user wants / needs to display the first display component on the page, then the first display component can be allowed to start. When the first display component is displayed on the page, it can either cover all or part of the second display component, or the second display component can be temporarily disabled, with the page currently only displaying the first display component. For example, if the page currently displays a chat interface, but the user might need to view news content from a news link within the chat interface, then the user can click on the news link to allow the chat interface to jump to the news content page, meaning the page is currently allowed to display the news content page. This ensures that even when the display component is triggered by the user's own actions, it is still allowed to start, thus meeting different user needs and improving the user experience.

[0082] After allowing the first display component to start, it is also possible to determine whether the first display component has started successfully (specifically, whether the first display component is successfully displayed on the page). If the first display component starts successfully, the currently displayed second display component is replaced by the first display component, that is, the first display component becomes the currently displayed second display component.

[0083] In the aforementioned display component control method, after detecting that the first display component to be started is triggered, the trigger source corresponding to the first display component is obtained. Based on the trigger source, it is determined whether the first display component was triggered by the user. If it was not triggered by the user, the first display component is prevented from starting, and the page continues to display the currently shown second display component. This method, by detecting whether the trigger source of the display component to be started is user-initiated and preventing its start when it is not, can disable or block the start of display components not actively triggered by the user, maintaining the original display components on the page. This ensures normal page browsing for the user and reduces user harassment. Simultaneously, by disabling or blocking the start of display components not actively triggered by the user, the user's property or system will not be affected, thus ensuring the security of user property and system.

[0084] The above embodiments mentioned that the trigger source of the display component can be obtained and detected. The following embodiments will describe in detail the specific process of obtaining the trigger source and the specific detection process.

[0085] In another embodiment, another method for controlling the display component is provided, such as Figure 5 As shown, the above S202 may include the following steps:

[0086] S302, obtain the package name of the first application where the first display component is triggered, and obtain the package name of the second application where the second display component is located.

[0087] In this step, the display component that is triggered to start is usually carried by an application after it is triggered to start. That is to say, after a certain first display component is triggered to start, it is usually because an application is triggered to start, which causes the first display component to be triggered to start. Then we can obtain the application and its package name that are carried by the first display component when it is triggered to start. The application is denoted as the first application, and its package name is denoted as the package name of the first application.

[0088] The package name used here refers to the application's unique identifier. One package name represents one application, and generally, two applications are not allowed to use the same package name; that is, the package names of two different applications are usually different.

[0089] Specifically, when the first display component is triggered to start, the package name of the first application in which it resides can be obtained, and when the second display component is displayed on the page, the package name of the second application in which the second display component resides can also be obtained. Here, the first application and the second application may be the same application.

[0090] Accordingly, S204 above may include the following steps:

[0091] S304, based on the consistency judgment result of the package name of the first application and the package name of the second application, determine whether the first display component is triggered by the user.

[0092] In this step, after obtaining the package name of the first application and the package name of the second application, the two package names can be compared for consistency to obtain the comparison result.

[0093] In one possible implementation, if the package name of the first application and the package name of the second application are the same, then the first display component is determined to be user-triggered. That is, if the comparison result shows that the package names of the two applications are the same, it can be concluded that the first application and the second application are the same application. Typically, the page currently displays the second display component, and the user triggers the first display component through their own actions on that page; therefore, the first display component is user-triggered.

[0094] In another possible implementation, if the package name of the first application and the package name of the second application are inconsistent, then the first display component is determined to be non-user-initiated. That is, if the comparison result shows that the package names of the two applications are different, it can be concluded that the first application and the second application are two different applications. In this case, it can be determined that the first display component was not triggered by the user, that is, it may be triggered by some malicious application, and therefore needs to be blocked.

[0095] In this embodiment, the package names of the applications containing the first and second display components are compared for consistency. Based on the consistency comparison result, it is determined whether the first display component was triggered by the user. This facilitates quick identification of whether the triggering behavior of the first display component is user-related, enabling rapid execution of subsequent display component control processes and improving the efficiency of display component control. Furthermore, by determining that the first display component is user-triggered when the package names match and non-user-triggered when the package names do not match, the triggering behavior of the first display component can be accurately determined, improving the accuracy of the judgment on the triggering behavior of the first display component.

[0096] The above embodiments mention controlling whether the first display component is allowed to start by determining whether the action is triggered by the user. The following embodiments will explain the specific process of further determining whether the first display component is allowed to start by determining whether the first display component or the second display component is a monitored component.

[0097] In another embodiment, another method for controlling the display component is provided, such as Figure 6 As shown, prior to S204 above, the method may further include the following steps:

[0098] S402, obtain the package name of the second application where the second display component is located.

[0099] For an explanation of this step, please refer to the explanation of the second display component in S302 above, which will not be repeated here.

[0100] S404, Detect whether the package name of the second application is in the preset first listener list.

[0101] The first monitoring list includes the package name of at least one application being monitored. This first monitoring list, which can be called CareList, includes the package name of the application being monitored and the name of the corresponding display component. The applications included in the first monitoring list can be all or some of the applications that the computer device can monitor in the Android system (here, "can be monitored" refers to applications that are capable of being monitored, because typically, some applications in the Android system cannot be monitored; the applications monitored here are generally considered to be applications that require attention, i.e., applications that may be at risk of being attacked).

[0102] Here, a first listener list can be pre-established. This list includes all or some of the application package names that can be monitored in the Android system. Simultaneously, the display components and their names corresponding to the applications in this first listener list can also be obtained. The names of each display component are then bound to the corresponding application package names and added to the first listener list. This first listener list can be dynamically configured by the user beforehand.

[0103] Specifically, after obtaining the package name of the second application, the computer device can input the package name of the second application into the first listening list to match the application package names and determine whether there is a matching application package name in the first listening list; here, whether they match refers to whether the application package names are the same.

[0104] S406, if the package name of the second application is not in the first listener list, then the first display component is allowed to start.

[0105] In this step, if there is no application in the first listener list that matches or is identical to the package name of the second application, that is, the package name of the second application is not in the first listener list, it indicates that the second application in which the second display component is located is not an application that needs to be listened to, and the second display component is not a component that needs to be monitored. The impact of the second display component being covered is not significant. Therefore, after the first display component is triggered to start, the first display component can be allowed to start, and there will be no further checks on whether the first display component was triggered by the user.

[0106] S408, if the package name of the second application is in the first listening list, then return to the above step of detecting whether the first display component is triggered by the user based on the trigger source.

[0107] In this step, if the first monitoring list contains an application whose package name matches or is identical to that of the second application (i.e., the package name of the second application is in the first monitoring list), it indicates that the second application containing the second display component is an application that needs to be monitored, and the second display component is also a component that needs to be monitored. Overriding the second display component could have a significant impact; therefore, after the first display component is triggered, it is necessary to further determine whether the triggered first display component was user-initiated, i.e., to return to and execute step S204 above.

[0108] In this embodiment, by detecting whether the package name of the application in which the second display component is located is in the first listening list, and allowing the first display component to start when the application's package name is not in the first listening list, display components that do not belong to the monitored application can be started, thus meeting actual needs and reducing the power consumption of the monitoring.

[0109] Furthermore, to improve monitoring efficiency, another embodiment provides an alternative method for controlling the display component, such as... Figure 7 As shown, prior to S204 above, the method may further include the following steps:

[0110] S502, obtain the package name of the first application where the first display component is located.

[0111] For an explanation of this step, please refer to the explanation of the first display component in S302 above, which will not be repeated here.

[0112] S504, check if the package name of the first application is in the preset second listening list.

[0113] The second listening list includes the package name of at least one application being monitored. The second listening list overlaps with the first listening list, meaning that the second listening list can be a part of the first listening list.

[0114] The second listening list here can be called WatchList. The second listening list includes the package name of the application being monitored and the name of the corresponding display component of the application. The applications included in the second listening list can be all or some of the applications that need to be monitored in the Android system of the computer device (the applications monitored in the second listening list are generally the applications that need to be paid special attention to, that is, the applications that are likely to be attacked).

[0115] Here, a second listener list can be pre-created. This list includes all or some of the application package names that need to be monitored in the Android system. Simultaneously, the display components and their names corresponding to the applications in this second listener list can also be obtained, and each display component name can be bound to its corresponding application package name before being added to the second listener list. This second listener list can also be dynamically configured by the user in advance.

[0116] Specifically, if the package name of the second application is in the first listening list, the computer device can obtain the package name of the first application and input it into the second listening list for application package name matching to determine whether there is a matching application package name in the second listening list; here, whether they match refers to whether the application package names are the same.

[0117] S506, if the package name of the first application is not in the second listener list, then the first display component is allowed to start.

[0118] In this step, if there is no application in the second monitoring list that matches or is identical to the package name of the first application, that is, the package name of the first application is not in the second monitoring list, it indicates that the first application containing the first display component is not an application that needs to be monitored closely, and the first display component is not a component that needs to be focused on, or in other words, the first display component is unlikely to be malicious, that is, it may not cause harm to the user's property or system. In this case, after the first display component is triggered to start, it can be allowed to start, and there will be no further checks on whether the first display component was triggered by the user.

[0119] S508, if the package name of the first application is in the second listening list, then return to the above steps of detecting whether the first display component is triggered by the user based on the trigger source.

[0120] In this step, if the second monitoring list contains an application whose package name matches or is identical to that of the first application, meaning the package name of the first application is in the second monitoring list, then the first application containing the first display component is an application that needs to be monitored closely, and the first display component is also a component that needs to be closely monitored. Therefore, after the first display component is triggered to start, it is necessary to further determine whether the triggered start of the first display component was voluntary by the user, that is, it is necessary to return to and execute the above step S204.

[0121] In this embodiment, by determining whether the package name of the application containing the first display component is in the second listener list in the first listener list, and continuing to detect whether the first display component is triggered by the user when it is not in the listener list, the control over the startup of the first display component is more precise, thereby improving the accuracy of controlling the first display component.

[0122] It should be noted that in the above embodiments S402-S408 and S502-S508 of this application, the Activity display component controller in the Activity Manager Native display component local manager is mainly used to monitor the launch operation of the Activity display component in real time by reflecting. In this way, it is not necessary to periodically poll which Activity display component is at the top of the stack. It is only necessary to listen to the applications and their corresponding display components in the first and second listening lists. It is not necessary to listen to or poll all of them, which can greatly save system resource consumption.

[0123] In another embodiment, such as Figure 8 As shown, prior to S204 above, the method may further include:

[0124] S602, Detect whether the first display component belongs to the second application where the second display component is located.

[0125] In this step, it can be determined whether the first display component belongs to the second application containing the second display component by checking whether the package name of the first application is consistent with the package name of the second application containing the second display component. For the process of using the package names of the two applications for consistency determination, please refer to the determination process in S304 above, which will not be repeated here.

[0126] S604, if applicable, allows the first display component to start.

[0127] In this step, if the package name of the first application is the same as that of the second application, it is determined that the first display component belongs to the second application where the second display component is located. This indicates that the first application and the second application are the same application. Usually, the page is currently displaying the second display component, which is related to the first display component. The first display component is unlikely to be malicious, so it can be allowed to start.

[0128] S606, if it does not belong to the category, then return to the above steps of detecting whether the first display component is triggered by the user based on the trigger source.

[0129] In this step, if the package name of the first application and the package name of the second application are inconsistent, it is determined that the first display component does not belong to the second application where the second display component is located. This indicates that the first application and the second application are not the same application. Therefore, it is necessary to continue to detect whether the first display component is triggered by the user, that is, to return to execute the above step S204.

[0130] It should be noted that S602-S606 here, S402-S408 and S502-S508 mentioned above can be executed in parallel or sequentially. For example, S402-S408 can be executed first, followed by S502-S508, and finally S602-S606. Of course, other orders are also possible, and no specific restrictions are made here.

[0131] In this embodiment, by detecting whether the first display component belongs to the application where the second display component is located, and allowing the first display component to start when it does, the startup efficiency of the display component can be improved; in addition, when it does not belong, it is necessary to continue to detect whether the first display component was triggered by the user, which can improve the accuracy of detecting the startup of the first display component.

[0132] Furthermore, to facilitate a more detailed explanation of the technical solution of this application, a specific embodiment is described below. Based on the above embodiment, see [link to embodiment]. Figure 9 As shown, the above method may include the following steps:

[0133] S1 monitors all display components to see if any display component has been triggered to start.

[0134] S2, after detecting that the first display component to be launched has been triggered, obtains the package name of the second application where the currently displayed second display component is located.

[0135] S3, determine whether the package name of the second application is in the first listening list. If it is, execute S4; otherwise, execute S9. The first listening list includes the package name of at least one monitored application.

[0136] S4. Determine if the package name of the first application is in the second listening list. If it is, execute S5; otherwise, execute S9. The second listening list includes the package name of at least one monitored application.

[0137] S5, determine whether the first display component belongs to the second application where the second display component is located. If not, execute S6; if yes, execute S9.

[0138] S6, obtain the trigger source corresponding to the first display component.

[0139] S7: Determine whether the first application was triggered by the user based on the trigger source. If so, execute S9; otherwise, execute S8.

[0140] S8 disables the first display component from starting and keeps the page displaying the currently shown second display component.

[0141] S9 allows the first display component to start.

[0142] S10: Determine whether the first display component has started successfully. If yes, execute S11; otherwise, return to execute S1.

[0143] S11, replace the currently displayed second display component with the first display component.

[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0145] Based on the same inventive concept, this application also provides a display component control device for implementing the display component control method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more display component control device embodiments provided below can be found in the limitations of the display component control method described above, and will not be repeated here.

[0146] In one embodiment, such as Figure 10 As shown, a display component control device is provided, including a trigger source acquisition module 11, a detection module 12, and a control module 13, wherein:

[0147] The trigger source acquisition module 11 is used to acquire the trigger source corresponding to the first display component after it is detected that the first display component to be started is triggered;

[0148] Detection module 12 is used to detect whether the first display component is triggered by the user based on the above trigger source;

[0149] The control module 13 is used to prevent the first display component from starting if the first display component is not triggered by the user, and to keep the page displaying the currently displayed second display component.

[0150] Optionally, the control module 13 is further configured to allow the first display component to start if the first display component is triggered by the user.

[0151] Optionally, the first and second display components mentioned above are display components under the Android system.

[0152] In another embodiment, another display component control device is provided. Based on the above embodiment, the trigger source acquisition module 11 may include a component package name acquisition unit. The component package name acquisition unit is used to acquire the package name of the first application where the first display component is triggered, and to acquire the package name of the second application where the second display component is located.

[0153] Accordingly, the detection module 12 may include a judgment unit, which is used to determine whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application.

[0154] Optionally, the aforementioned judgment unit is specifically used to determine that the first display component is user-triggered if the package name of the first application is the same as that of the second application; and to determine that the first display component is not user-triggered if the package name of the first application is different from that of the second application.

[0155] In another embodiment, another display component control device is provided. Based on the above embodiments, before the detection module 12 detects whether the first display component is triggered by the user, the device may further include: an application package name acquisition module and a list detection module, wherein:

[0156] The application package name acquisition module is used to obtain the package name of the second application in which the second display component is located;

[0157] The list detection module is used to detect whether the package name of the second application is in a preset first monitoring list; the first monitoring list includes the package name of at least one monitored application.

[0158] The aforementioned control module 13 is further configured to allow the first display component to start if the package name of the second application is not in the first listening list; or, if the package name of the second application is in the first listening list, return to the above-mentioned step of detecting whether the first display component is triggered by the user based on the trigger source.

[0159] Optionally, the control module 13 may include a packet name detection unit and a control unit, wherein:

[0160] The package name detection unit is used to detect whether the package name of the first application is in a preset second monitoring list if the package name of the second application is in the first monitoring list; the second monitoring list includes the package name of at least one monitored application, and the second monitoring list has an intersection with the first monitoring list;

[0161] The control unit is configured to allow the first display component to start if the package name of the first application is not in the second listening list; or, if the package name of the first application is in the second listening list, return to the above steps of detecting whether the first display component was triggered by the user.

[0162] In another embodiment, another display component control device is provided. Based on the above embodiments, before the detection module 12 detects whether the first display component is triggered by the user according to the trigger source, the device may further include: a component detection module, wherein:

[0163] The component detection module is used to detect whether the first display component belongs to the second application where the second display component is located;

[0164] The aforementioned control module 13 is further configured to, if it belongs to the category, allow the first display component to start; or, if it does not belong to the category, return to the above steps of detecting whether the first display component is triggered by the user.

[0165] Each module in the aforementioned display component control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0166] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0167] After detecting that the first display component to be launched is triggered, obtain the trigger source corresponding to the first display component; detect whether the first display component is triggered by the user based on the trigger source; if the first display component is not triggered by the user, then prevent the first display component from starting and keep the page displaying the currently displayed second display component.

[0168] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0169] Obtain the package name of the first application where the first display component is triggered, and obtain the package name of the second application where the second display component is triggered; determine whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application.

[0170] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0171] If the package name of the first application is the same as the package name of the second application, then the first display component is determined to be triggered by the user; if the package name of the first application is different from the package name of the second application, then the first display component is determined to be triggered by a non-user.

[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0173] Obtain the package name of the second application where the second display component is located; detect whether the package name of the second application is in a preset first listening list; the first listening list includes the package name of at least one monitored application; if the package name of the second application is not in the first listening list, allow the first display component to start; or, if the package name of the second application is in the first listening list, return to the above steps of detecting whether the first display component is triggered by the user.

[0174] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0175] If the package name of the second application is in the first listening list, then check whether the package name of the first application is in the preset second listening list; the second listening list includes the package name of at least one monitored application, and the second listening list intersects with the first listening list; if the package name of the first application is not in the second listening list, then allow the first display component to start; or, if the package name of the first application is in the second listening list, then return to the above steps of detecting whether the first display component was triggered by the user.

[0176] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0177] Detect whether the first display component belongs to the second application where the second display component is located; if it does, allow the first display component to start; or, if it does not, return to the above steps of detecting whether the first display component was triggered by the user based on the trigger source.

[0178] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0179] If the first display component is triggered by the user, then the first display component is allowed to start.

[0180] In one embodiment, the first display component and the second display component are display components under the Android system.

[0181] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0182] After detecting that the first display component to be launched is triggered, obtain the trigger source corresponding to the first display component; detect whether the first display component is triggered by the user based on the trigger source; if the first display component is not triggered by the user, then prevent the first display component from starting and keep the page displaying the currently displayed second display component.

[0183] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0184] Obtain the package name of the first application where the first display component is triggered, and obtain the package name of the second application where the second display component is triggered; determine whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application.

[0185] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0186] If the package name of the first application is the same as that of the second application, then the first display component is determined to be triggered by the user; if the package name of the first application is different from that of the second application, then the first display component is determined to be triggered by a non-user.

[0187] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0188] Obtain the package name of the second application where the second display component is located; detect whether the package name of the second application is in a preset first listening list; the first listening list includes the package name of at least one monitored application; if the package name of the second application is not in the first listening list, allow the first display component to start; or, if the package name of the second application is in the first listening list, return to the above steps of detecting whether the first display component is triggered by the user.

[0189] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0190] If the package name of the second application is in the first listening list, then check whether the package name of the first application is in the preset second listening list; the second listening list includes the package name of at least one monitored application, and the second listening list intersects with the first listening list; if the package name of the first application is not in the second listening list, then allow the first display component to start; or, if the package name of the first application is in the second listening list, then return to the above steps of detecting whether the first display component was triggered by the user.

[0191] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0192] Detect whether the first display component belongs to the second application where the second display component is located; if it does, allow the first display component to start; or, if it does not, return to the above steps of detecting whether the first display component was triggered by the user based on the trigger source.

[0193] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0194] If the first display component is triggered by the user, then the first display component is allowed to start.

[0195] In one embodiment, the first display component and the second display component are display components under the Android system.

[0196] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0197] After detecting that the first display component to be launched is triggered, obtain the trigger source corresponding to the first display component; detect whether the first display component is triggered by the user based on the trigger source; if the first display component is not triggered by the user, then prevent the first display component from starting and keep the page displaying the currently displayed second display component.

[0198] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0199] Obtain the package name of the first application where the first display component is triggered, and obtain the package name of the second application where the second display component is triggered; determine whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application.

[0200] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0201] If the package name of the first application is the same as the package name of the second application, then the first display component is determined to be triggered by the user; if the package name of the first application is different from the package name of the second application, then the first display component is determined to be triggered by a non-user.

[0202] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0203] Obtain the package name of the second application where the second display component is located; detect whether the package name of the second application is in a preset first listening list; the first listening list includes the package name of at least one monitored application; if the package name of the second application is not in the first listening list, allow the first display component to start; or, if the package name of the second application is in the first listening list, return to the above steps of detecting whether the first display component is triggered by the user.

[0204] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0205] If the package name of the second application is in the first listening list, then check whether the package name of the first application is in the preset second listening list; the second listening list includes the package name of at least one monitored application, and the second listening list intersects with the first listening list; if the package name of the first application is not in the second listening list, then allow the first display component to start; or, if the package name of the first application is in the second listening list, then return to the above steps of detecting whether the first display component was triggered by the user.

[0206] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0207] Detect whether the first display component belongs to the second application where the second display component is located; if it does, allow the first display component to start; or, if it does not, return to the above steps of detecting whether the first display component was triggered by the user based on the trigger source.

[0208] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0209] If the first display component is triggered by the user, then the first display component is allowed to start.

[0210] In one embodiment, the first display component and the second display component are display components under the Android system.

[0211] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0212] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. 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). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0213] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0214] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for controlling a display component, characterized in that, The method includes: After detecting that the first display component to be launched has been triggered, obtain the package name of the first application where the first display component was triggered, and obtain the package name of the second application where the currently displayed second display component is located; Based on the package name of the first application, the package name of the second application, and the listening list, it is determined whether the package name of the first application or the package name of the second application is in the listening list; the listening list includes a preset first listening list and a second listening list; the second listening list is a part of the first listening list, representing the package name of the application that needs to be focused on and the name of the display component corresponding to the application; If the package name of the second application is not in the first listening list, then the first display component is allowed to start; If the registration of the second application is in the first listening list, and the package name of the first application is not in the second listening list, then the first display component is allowed to start; If the package name of the first application is in the second listener list, and the package name of the second application is in the first listener list, then based on the consistency judgment result of the package name of the first application and the package name of the second application, it is determined whether the first display component is triggered by the user. If the first display component is not triggered by the user, then the first display component is prevented from starting, and the page continues to display the currently displayed second display component.

2. The method according to claim 1, characterized in that, The step of determining whether the first display component is triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application includes: If the package name of the first application is the same as the package name of the second application, then the first display component is determined to be triggered by the user. If the package name of the first application and the package name of the second application are inconsistent, then the first display component is determined to be non-user-triggered.

3. The method according to claim 1 or 2, characterized in that, The first listening list includes the package name of the application that can perform the listening and the name of the display component corresponding to the application.

4. The method according to claim 1 or 2, characterized in that, The configuration process for the first monitoring list includes: Bind the name of the display component corresponding to the application that can be monitored in the system to the package name of the corresponding application, and add them to the first monitoring list accordingly.

5. The method according to claim 1 or 2, characterized in that, The step of determining whether the first display component is user-triggered based on the consistency judgment result of the package name of the first application and the package name of the second application includes: Detect whether the first display component belongs to the second application where the second display component is located; If it belongs to the category, the first display component is allowed to start; otherwise, if it does not belong to the category, the process returns to the step of determining whether the first display component was triggered by the user based on the consistency judgment result of the package name of the first application and the package name of the second application.

6. A display component control device, characterized in that, The device includes: The trigger source acquisition module is used to obtain the package name of the first application where the first display component is triggered, and the package name of the second application where the currently displayed second display component is located, after listening to the first display component to be launched being triggered. The detection module is used to determine whether the package name of the first application or the package name of the second application is in the listening list based on the package name of the first application, the package name of the second application, and the listening list. The listening list includes a preset first listening list and a second listening list. The second listening list is a part of the first listening list and represents the package name of the application that needs to be monitored and the name of the corresponding display component. If the package name of the second application is not in the first listening list, the first display component is allowed to start. If the package name of the second application is in the first listening list and the package name of the first application is not in the second listening list, the first display component is allowed to start. If the package name of the first application is in the second listening list and the package name of the second application is in the first listening list, the module determines whether the first display component is triggered by the user based on the consistency judgment result of the package names of the first application and the second application. The control module is used to prevent the first display component from starting if the first display component is not triggered by the user, and to keep the page displaying the currently displayed second display component.

7. The apparatus according to claim 6, characterized in that, The detection module includes: a judgment unit; The determination unit is specifically used to determine that the first display component is user-triggered if the package name of the first application is the same as that of the second application; and to determine that the first display component is not user-triggered if the package name of the first application is different from that of the second application.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Popup window interception method and terminal

    CN106126562A

  • Popup window control method of application window, terminal and computer-readable storage medium

    CN107256147A