Application program interception method and apparatus, and storage medium and electronic device
By prioritizing the historical foreground and background running data of the application and determining the interception strategy, the problem of low application interception accuracy in the existing technology is solved, and real-time and accurate interception effects are achieved.
Patent Information
- Application Number
- PCT/CN2024/082812
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-24
- Filing Date
- 2024-03-20
- Publication Date
- 2024-10-03
AI Technical Summary
The existing technology has low accuracy when intercepting applications in electronic devices, and requires the remaining resources of the computing device, resulting in interception lag.
By obtaining the historical foreground running data and historical background running data of the application, priority scoring is performed based on the two, and the target interception strategy is determined to achieve real-time and accurate application interception.
It improves the accuracy of application interception, avoids the calculation of device resources, realizes real-time interception, and enhances the effectiveness of interception.
Smart Images

Figure CN2024082812_03102024_PF_FP_ABST
Abstract
Description
Application program interception method, device, storage medium, and electronic device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 24, 2023, with application number 202310327614.X and invention name “Application interception method, device, storage medium and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of electronic devices, and in particular to a method, device, storage medium, and electronic device for intercepting an application. Background Art
[0003] With the continuous promotion of computer technology, more and more applications can be loaded into electronic devices. However, loading too many applications will cause the resources of the electronic device to be occupied, thereby affecting the operating speed of the electronic device.
[0004] To address this issue, one approach can calculate the remaining resources of the electronic device and intercept the processes of certain applications, thereby freeing up some memory. However, this approach still has the problem of low interception accuracy. Technical Solutions
[0005] The embodiments of the present application provide a method, device, storage medium, and electronic device for intercepting an application program, which can improve the accuracy of intercepting the application program.
[0006] In a first aspect, an embodiment of the present application provides a method for intercepting an application, the method comprising:
[0007] Get the historical foreground running data and historical background running data of the application;
[0008] Scoring the priority of the application based on historical foreground running data and historical background running data to obtain a priority score;
[0009] Determine the targeted blocking strategy for the application based on the priority score.
[0010] In a second aspect, an embodiment of the present application further provides an application interception device, comprising:
[0011] The data acquisition module is used to obtain the historical foreground running data and historical background running data of the application;
[0012] The scoring module is used to score the priority of the application based on historical foreground operation data and historical background operation data to obtain a priority score;
[0013] The policy acquisition module is used to determine the target interception policy for the application based on the priority score.
[0014] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program runs on a computer, the computer executes an interception method for an application program as provided in any embodiment of the present application.
[0015] In a fourth aspect, an embodiment of the present application further provides an electronic device comprising a processor and a memory, wherein the memory contains a computer program, and the processor calls the computer program to execute an interception method of an application program as provided in any embodiment of the present application.
[0016] The technical solution provided by the embodiment of the present application obtains the historical foreground data and historical background data of the application to score the priority of the application based on the two, thereby selecting the corresponding target interception strategy based on the priority score. Compared with the existing technology, it does not need to calculate the remaining resources of the electronic device, and it also avoids the lag in intercepting the application due to the calculation of the remaining resources. It can realize real-time interception of the application and improve the accuracy of interception. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] FIG1 is a schematic diagram of an application scenario of the method for intercepting an application program provided in an embodiment of the present application.
[0019] FIG2 is a flow chart of the method for intercepting an application program provided in an embodiment of the present application.
[0020] FIG3 is a schematic diagram of step 120 in the method provided in an embodiment of the present application.
[0021] FIG4 is a schematic diagram of updating the priority score in the method provided in an embodiment of the present application.
[0022] FIG5 is a schematic diagram of updating the priority score when the foreground running frequency is greater than the background running frequency in the method provided in an embodiment of the present application.
[0023] FIG6 is a schematic diagram of determining the score adjustment direction and score adjustment range according to the duration difference in FIG5 .
[0024] FIG7 is a schematic diagram of determining the score adjustment range in the direction of score improvement in FIG5.
[0025] FIG8 is a schematic diagram of updating the priority score when the foreground running frequency is not greater than the background running frequency in the method provided in an embodiment of the present application.
[0026] FIG9 is a schematic diagram of the structure of an interception device for an application program provided in an embodiment of the present application.
[0027] FIG10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0028] Implementation Methods of the Application
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0030] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] The present application provides an application interception method. The execution subject of the application interception method can be the application interception device provided in the present application, or an electronic device integrated with the application interception device. The application interception device can be implemented in hardware or software, and the electronic device can be a smartphone, tablet computer, PDA, desktop computer, smart screen, smart watch, etc.
[0032] In order to better understand the interception method of the application provided by this application, an application scenario is first provided here. Please refer to Figure 1. Figure 1 is a schematic diagram of the application scenario of the interception method of the application provided in the embodiment of this application. The applications running on the mobile phone include video software, chat software, payment software, audio software, learning software, work software, etc., by pre-prioritizing different applications and setting a priority rating list to include the priority ratings of different applications. When the application is running, the priority rating of the application is obtained from the priority rating list, and the application is intercepted according to the priority rating.
[0033] Please refer to Figure 2, which is a flow chart of the method for intercepting an application provided in an embodiment of the present application. The specific flow of the method for intercepting an application provided in an embodiment of the present application can be as follows:
[0034] 110. Get the historical foreground running data and historical background running data of the application.
[0035] The application may refer to any application installed in the electronic device, or may refer to an application that needs priority scoring and is installed in the electronic device.
[0036] Historical foreground running data describes the application's foreground running status during a historical time period. Correspondingly, historical background running data describes the application's background running status during the same historical time period. Historical foreground running data and historical background running data occupy the same historical time period.
[0037] The historical time period is calculated from the current moment. It can refer to the period from the moment the application is installed on the electronic device to the current moment. It can also refer to the period within a preset time period before the current moment, which can be 1 month, 2 months, 3 months, 6 months, 1 year, etc.
[0038] The historical foreground running data may include data such as the time, duration, and frequency of the application running in the foreground, and the historical background running data may include data such as the time, duration, and frequency of the application running in the background.
[0039] 120. Score the priority of the application based on historical foreground running data and historical background running data to obtain a priority score.
[0040] The system comprehensively analyzes historical foreground and background running data to determine the app's propensity to run in the foreground and background. If an app's propensity to run in the foreground is higher than its propensity to run in the background, the app is assigned a higher priority score. If an app's propensity to run in the foreground is lower than its propensity to run in the background, the app is assigned a lower priority score.
[0041] 130. Determine the target interception strategy for the application based on the priority score.
[0042] The corresponding relationship between the priority score and the interception strategy is preset, and the two can be a one-to-one relationship or a many-to-one relationship.
[0043] The priority score is inversely proportional to the interception strength of the interception policy. That is, the higher the priority score, the less likely the application is to be intercepted, and the higher the permissions of the application. The lower the priority score, the easier it is to intercept the application, and the lower the permissions of the application.
[0044] For example, interception strategies include, but are not limited to: not intercepting when the application is running, intercepting when the application is running, intercepting when the application is running in the background, intercepting when the application has been running in the foreground or background for a predetermined time period, etc. Since there are many options, they are not listed here one by one.
[0045] After step 130, the following steps are further performed:
[0046] When the application is started, the target interception policy corresponding to the application is called and executed.
[0047] During specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.
[0048] The application interception method of the embodiment of the present application can prioritize different applications based on their historical foreground and background running data, then set corresponding target interception policies for the applications based on the priority scores. When the applications are launched, the applications are intercepted according to the corresponding target interception policies. This enables timely interception of applications and improves interception accuracy.
[0049] The following embodiments describe in detail the method for intercepting an application program provided in the embodiments of the present application, as follows.
[0050] Please refer to Figure 3, which is a schematic diagram of step 120 in the method provided in an embodiment of the present application. In some embodiments, step 120 includes:
[0051] The priority of the application is scored based on the historical foreground running data and its corresponding foreground weight, as well as the historical background running data and its corresponding background weight, to obtain a priority score, wherein the foreground weight is higher than the background weight.
[0052] For example, the historical foreground running data and the historical background running data may include data such as running time, running frequency, etc. When scoring the priority of an application based on the historical foreground running data and the historical background running data, the scoring may be performed using single-dimensional data or non-single-dimensional data.
[0053] As an embodiment, the method of scoring using single-dimensional data includes: obtaining the first total running time of the application running in the foreground based on the historical foreground running data, and obtaining the second total running time of the application running in the background based on the historical background running data. Calculate the foreground score of the first total running time based on the benchmark total running time, and calculate the background score of the second total running time. And obtain the priority score based on the foreground weight and the foreground score, and the background weight and the background score. The expression is as follows: M = m / G*j; N = n / G*j; W = M*f1+N*f2;
[0054] Among them, G represents the benchmark total running time, j represents the scoring factor, m represents the first total running time, M represents the foreground score, n represents the second total running time, N represents the background score, f1 represents the foreground weight, f2 represents the background weight, and W represents the priority score.
[0055] It is understandable that single-dimensional data can also include run frequency, that is, the first total run frequency of the application running in the foreground is obtained based on the historical foreground run data, and the second total run frequency of the application running in the background is obtained based on the historical background run data. The foreground score of the first total run frequency is calculated based on the baseline total run frequency, and the background score of the second total run frequency is calculated. The priority score is obtained based on the foreground weight and the foreground score, and the background weight and the background score. The expression can be referred to the above formula and will not be repeated here.
[0056] As another embodiment, the method of scoring using non-single-dimensional data includes: obtaining the first total running time and the first total running frequency of the application running in the foreground based on historical foreground running data, and obtaining the second total running time and the second total running frequency of the application running in the background based on historical background running data. Calculate the foreground first sub-score of the first total running time based on the benchmark total running time, calculate the foreground second sub-score of the first total running frequency based on the benchmark total running frequency, and obtain the foreground score based on the foreground first sub-score and the foreground second sub-score. Calculate the background first sub-score of the second total running time based on the benchmark total running time, calculate the background second sub-score of the second total running frequency based on the benchmark total running frequency, and obtain the background score based on the background first sub-score and the background second sub-score. And obtain the priority score based on the foreground weight and the foreground score, and the background weight and the background score.
[0057] It is understandable that the above only provides two methods for determining priority scores, and these methods are not intended to limit this application. In addition, the methods of prioritizing applications based on historical foreground operation data and its corresponding foreground weights, as well as historical background operation data and its corresponding background weights, can be applied to the embodiments of this application and fall within the scope of protection claimed by this application.
[0058] Please refer to Figure 4, which is a schematic diagram of updating the priority score in the method provided in an embodiment of the present application. In some embodiments, before executing step 130, the method further includes:
[0059] 10. Get the real-time foreground running data and real-time background running data of the application;
[0060] 11. Update the priority score based on real-time foreground operation data and real-time background operation data.
[0061] During the application's operation, real-time foreground operation data of the application running in the foreground and real-time background operation data of the application running in the background are continuously recorded. The data content of the real-time foreground operation data and real-time background operation data refers to the historical foreground operation data and historical background operation data mentioned above, and will not be repeated here.
[0062] In addition, when updating the priority score based on real-time foreground running data and real-time background running data, the priority score of the application is dynamically fine-tuned based on the real-time foreground running data and real-time background running data on the basis of the priority score calculated above, thereby realizing dynamic update of the priority score, and dynamically updating the corresponding target interception strategy based on the updated priority score, thereby achieving more timely and accurate interception of the application, and in line with the actual operation of the application.
[0063] Please refer to Figure 5, which is a schematic diagram of updating the priority score when the foreground running frequency is greater than the background running frequency in the method provided in an embodiment of the present application. In some embodiments, the real-time foreground running data includes the total foreground running time and foreground running frequency of the application during the scoring update period, and the real-time background running data includes the total background running time and background running frequency of the application during the scoring update period. If the foreground running frequency is greater than the background running frequency, step 10 includes:
[0064] 101. Determine the direction and extent of score adjustment based on the difference between the total duration of foreground operation and the total duration of background operation;
[0065] 102. Adjust the priority score according to the score adjustment range in the score adjustment direction.
[0066] The score update cycle can be set according to actual needs, such as 1 day, 2 days, 3 days, 1 week, 2 weeks, etc.
[0067] During the scoring update cycle, you can count the frequency of an app's foreground and background runs. If the foreground run frequency is greater than the background run frequency, it indicates that the app tends to run in the foreground. In this case, you can determine how to adjust the priority score based on the total foreground and background run time of the app during the scoring update cycle.
[0068] Specifically, the adjustment of the priority score includes two aspects, namely the score adjustment direction and the score adjustment range. Among them, the score adjustment direction includes the score increase direction and the score reduction direction. The score adjustment range is determined according to the difference value of the difference between the total foreground running time and the total background running time. Of course, it can also be determined according to the difference value of the frequency difference between the foreground running frequency and the background running frequency. It can also be determined in combination with the difference value of the difference between the total foreground running time and the total background running time, as well as the difference value of the frequency difference between the foreground running frequency and the background running frequency. The specific implementation method is not limited here.
[0069] Among them, the score adjustment direction is determined according to the relative size of the total foreground running time and the total background running time. For example, when the total foreground running time is greater than the total background running time, the score adjustment direction is determined to be the score increase direction, and when the total foreground running time is not greater than the total background running time, the score adjustment direction is determined to be the score decrease direction. Of course, the score adjustment direction can also be determined according to the relative size of the foreground running frequency and the background running frequency. For example, when the foreground running frequency is greater than the background running frequency, the score adjustment direction is determined to be the score increase direction, and when the foreground running frequency is not greater than the background running frequency, the score adjustment direction is determined to be the score decrease direction.
[0070] This embodiment fine-tunes an application's priority score based on the total foreground runtime and frequency, as well as the total background runtime and frequency, within the score update cycle. This allows for real-time dynamic updates of the application's priority score, improving the accuracy of the application's priority score. Furthermore, the direction and magnitude of the score adjustment are accurately determined during the priority score adjustment process, enabling faster and more accurate fine-tuning of the priority score and increasing the rate at which the priority score is updated.
[0071] In some embodiments, step 101 includes:
[0072] 1011. Determine whether the difference between the total foreground running time and the total background running time is greater than a first preset threshold;
[0073] 1012. If yes, determine that the score adjustment direction is to increase the score, and determine the score adjustment range in the direction of increasing the score based on the time difference;
[0074] 1013. If not, the score adjustment direction is determined to be a score reduction direction, and the score adjustment range in the score reduction direction is determined based on the time difference.
[0075] Please refer to Figure 6, which is a schematic diagram of determining the score adjustment direction and score adjustment range based on the duration difference in Figure 5. In this embodiment, when the foreground operation frequency is greater than the background operation frequency, the duration difference between the two is determined based on the total foreground operation duration and the total background operation duration, wherein the duration difference may include information such as the duration difference and the duration ratio between the two. When the duration difference between the two is a positive number, it means that the total foreground operation duration is greater than the total background operation duration. When the duration difference between the two is a negative number, it means that the total foreground operation duration is not greater than the total background operation duration. When the duration difference between the two is a positive number and the duration ratio between the two is large, it means that the total foreground operation duration is much greater than the total background operation duration. When the duration ratio between the two is small, it means that the total foreground operation duration is greater than the total background operation duration.
[0076] A first preset threshold is set to assess the degree of difference between the total foreground running time and the total background running time. Examples of the degree of difference include: the total foreground running time is much greater than the total background running time, the total foreground running time is slightly greater than the total background running time, the total foreground running time is slightly less than the total background running time, and the total foreground running time is much less than the total background running time.
[0077] For example, the first preset threshold value may indicate that the total duration of foreground operation is slightly longer than the total duration of background operation. When the duration difference is greater than the first preset threshold value, it means that the total duration of foreground operation is much longer than the total duration of background operation. In this case, the score adjustment direction is determined to be the direction of improving the score, that is, increasing the priority score. When the duration difference is not greater than the first preset threshold value, it means that the total duration of foreground operation is slightly longer than the total duration of background operation, or the duration of foreground operation is less than or equal to the total duration of background operation. In this case, the score adjustment direction is determined to be the direction of reducing the score, that is, reducing the priority score.
[0078] After determining the direction of the score adjustment, the magnitude of the score adjustment can also be determined based on the duration difference, where the duration difference is proportional to the score adjustment magnitude. When the duration difference is large, the priority score can be significantly increased in the direction of improving the score; when the duration difference is small, the priority score can be slightly increased in the direction of improving the score. Alternatively, when the duration difference is large, the priority score can be significantly decreased in the direction of decreasing the score; when the duration difference is small, the priority score can be slightly decreased in the direction of decreasing the score.
[0079] Please refer to Figure 7, which is a schematic diagram of determining the score adjustment range in the direction of improving the score in Figure 5. In some embodiments, the real-time foreground running data also includes the preset single running time of the application within the score update cycle and the single foreground running time of each foreground run. Before step 1012, the method further includes:
[0080] 1001. Count the frequency of single runs where the foreground single run duration is greater than the preset single run duration;
[0081] 1002. Determine whether a first frequency difference between the single operation frequency and the foreground operation frequency is greater than a second preset threshold;
[0082] 1003. If yes, then determine the score adjustment range in the direction of score improvement based on the first frequency difference and duration difference;
[0083] If not, execute step 1012 to determine the score adjustment range in the direction of improving the score based on the time difference.
[0084] This embodiment provides an implementation method for improving the priority score based on the difference in duration. Specifically, within the score update cycle, the foreground single running duration of each application running in the foreground is also counted.
[0085] The preset single running time indicates the time that the application needs to spend running in the foreground or background each time during the rating update cycle. The preset single running time is a preset fixed value, or a value that is adaptively adjusted according to actual needs.
[0086] The foreground single run duration indicates the duration that the application spent running in the foreground each time during the score update cycle. That is, each time the application runs in the foreground, the duration of that run is recorded.
[0087] Here we take an example to illustrate the relationship between the foreground single run time and the foreground and background single run time. For example, within the score update cycle, the application runs X times, of which the application runs Y times in the foreground and Z times in the background, X = Y + Z. The set of the foreground and background single run time is H X , H X =(X t1 , X t2 ...X tn ), X tn It represents the time t that the application takes to run for the nth time. The set of single foreground running time is H Y , H Y =(Y t1 , Y t2 ...Y tn ), Y tnIndicates the time t that the application spends running in the foreground for the nth time.
[0088] For the foreground single run duration, the foreground single run duration is compared with the preset single run duration. The number of times the foreground single run duration exceeds the preset single run duration is counted, and this number is considered the single run frequency. For example, if the foreground single run occurs 10 times and 6 of them are longer than the preset single run duration, then 6 times is considered the single run frequency.
[0089] Exemplarily, the range of adjustment for the priority score in the direction of improving the score is also determined based on the first frequency difference between the single run frequency and the foreground run frequency. Specifically, when the first frequency difference is greater than the second preset threshold, it means that the time spent by the application in the foreground running multiple times is greater than the preset single run time, or that the application has been running in the foreground for a long time multiple times within the score update cycle. In this case, the range of adjustment for the priority score in the direction of improving the score can be determined based on the first frequency difference and the time difference.
[0090] If the first frequency difference is not greater than the second preset threshold, it indicates that the application runs in the foreground less frequently, or the duration of its foreground execution is shorter, or that it runs in the foreground less frequently and the duration of each execution is shorter. In this case, the magnitude of the priority score adjustment can be determined based on the duration difference, i.e., step 1012 is executed.
[0091] For example, when determining the score adjustment range of the priority score in the direction of improving the score based on the first frequency difference and the duration difference, the first frequency difference and the duration difference can also be superimposed to obtain a score adjustment range with a larger value.
[0092] Here is an example. For example, the score adjustment range determined based on the first frequency difference is L1, and the score adjustment range determined based on the duration difference is L2. L1+L2 is used as the final score adjustment range in the direction of improving the score.
[0093] This embodiment considers the duration of each foreground session, allowing for larger rating adjustments when an application frequently and for a longer period of time, thereby significantly improving the application's priority score. This allows for comprehensive consideration of different dimensions within the rating update cycle, significantly improving the accuracy of rating adjustment settings.
[0094] In some embodiments, after step 1013, the method further includes:
[0095] 1014. Reduce the preset single run time based on the time difference.
[0096] After determining that the score adjustment direction is a score reduction direction, when determining the score adjustment range in the score reduction direction based on the duration difference, the preset single running time is also reduced based on the duration difference.
[0097] The greater the difference in duration, the greater the reduction in the preset single running duration; and the smaller the difference in duration, the smaller the reduction in the preset single running duration.
[0098] By lowering the score of the application, its preset single running time is also reduced, thereby limiting the application to run for a longer time each time, setting a double interception threshold for the application, and improving the accuracy of intercepting the application.
[0099] In some embodiments, step 1013 includes:
[0100] Determining that the score adjustment direction is a score reduction direction, and determining whether a difference between the background running frequency and a second frequency of the preset background running frequency is greater than a fourth preset threshold;
[0101] If so, the score adjustment range in the direction of score reduction is determined based on the second frequency difference and duration difference;
[0102] If not, the score adjustment range in the direction of score reduction is determined based on the difference in duration.
[0103] This embodiment provides an implementation method for reducing the priority score based on the difference in duration. Specifically, the background running frequency of the application during the score update cycle is compared with the preset background running frequency to determine the score adjustment range of the application in the direction of score reduction.
[0104] The second frequency difference indicates the frequency difference between the background running frequency and the preset background running frequency. When the second frequency difference is greater than the fourth preset threshold, it means that the background running frequency is much greater than the preset background running frequency. In this case, the score adjustment range is determined based on the second frequency difference and the duration difference. Specifically, the score adjustment range corresponding to the second frequency difference and the score adjustment range corresponding to the duration difference are superimposed, and the superimposed result is used as the final score adjustment range.
[0105] When the second frequency difference is not greater than the fourth preset threshold, it indicates that the background operation frequency is slightly greater than, equal to, or less than the preset background operation frequency. In this case, the score adjustment range is determined based on the duration difference. The method for determining the score adjustment range based on the duration difference can be referred to the above-mentioned content and will not be repeated here.
[0106] In some embodiments, before step 1001, the method further includes:
[0107] When the single running time in the foreground exceeds the preset single running time, an application interception prompt is issued;
[0108] Obtaining a cancel interception operation in response to an application interception prompt;
[0109] determining whether the difference between the number of application interception prompts and the number of cancel interception operations is greater than a third preset threshold;
[0110] If so, increase the preset single run time.
[0111] In this embodiment, when the duration of a single foreground run exceeds a preset single run duration, the user is prompted to block the application. This notification can be provided, for example, by displaying a pop-up window. Alternatively, a notification message can be used, and the specific setting can be tailored to actual needs and is not limited here.
[0112] When a pop-up window is displayed to block an application, the pop-up window may include the content of the prompt and an action button related to the prompt. The prompt message may read, for example, "** has been running in the foreground for longer than the preset single run duration. Please confirm whether to block **." The action button may be, for example, a "Cancel Block" button. When the user clicks the "Cancel Block" button, the electronic device will no longer block the application.
[0113] If the user does not click the "Cancel Blocking" button when prompted to block an application, the electronic device will continue to block the application. During the application's operation, the number of application blocking prompts and the number of times the electronic device responds to cancel blocking operations are counted. If the difference between the two numbers is greater than a third preset threshold, it indicates that the user does not need to block the application too many times. In this case, the preset single run time can be increased, thereby reducing the probability of the application being blocked.
[0114] When the difference in the number of times is not greater than the third preset threshold, the preset single running time is not adjusted.
[0115] Please refer to Figure 8, which is a schematic diagram of updating the priority score when the foreground running frequency is not greater than the background running frequency in the method provided in an embodiment of the present application. In some embodiments, if the foreground running frequency is not greater than the background running frequency, step 11 includes:
[0116] Determine the adjustment coefficient based on the difference between the total foreground running time and the total background running time;
[0117] The priority score is mapped to a preset low score interval according to the adjustment coefficient to update the priority score.
[0118] In this embodiment, a correspondence between the duration difference and the adjustment coefficient is pre-set, and after the duration difference is determined, the corresponding adjustment coefficient can be matched. The duration difference is proportional to the adjustment coefficient, and the larger the duration difference, the larger the adjustment coefficient.
[0119] There is at least one preset low score interval. When 100 is the full score, any interval between 0-50 can be used as the preset low score interval. The current priority score of the application is adjusted by the adjustment coefficient to map the priority score to the preset low score interval. When adjusting the priority score, the product of the adjustment coefficient and the priority score can be calculated to map the priority score to the preset low score interval. For example, if the preset low score interval is 0-40 points, the adjustment coefficient is 0.4, and the priority score is 85, the product of the two is 34 points, and the priority score can be mapped to the low score interval of 0-40 points.
[0120] In this embodiment, by adjusting the coefficient to map the priority score to a low score, the priority score can be reduced to a large extent, thereby making the application program more easily intercepted.
[0121] In some embodiments, the real-time background running data further includes the background availability time of the application within the rating update cycle; before step 101, the method further includes:
[0122] Calculate the proportion of the first duration in the total background running time to the background available time;
[0123] Calculate the proportion of the backend available time in the second time period of the rating update cycle;
[0124] Determine whether the first duration ratio is greater than the second duration ratio;
[0125] If so, the priority score is mapped to a preset low score interval;
[0126] If not, the score adjustment direction and score adjustment range are determined based on the difference between the total foreground running time and the total background running time.
[0127] The background available time refers to the total time that the application can run in the background during the rating update cycle. Each time the application runs in the background, the background available time is reduced accordingly. After the background available time is consumed, the application cannot run in the background during the current rating update cycle.
[0128] During the scoring update cycle, the first duration ratio of the total background running time to the background available time can also be calculated, where the first duration ratio indicates the extent to which the background available time is consumed. And the second duration ratio of the background available time in the scoring update cycle can be calculated, where the second duration ratio indicates how quickly the background available time is consumed. When the first duration ratio is greater than the second duration ratio, it means that the background available time is consumed too quickly in the early stage of the scoring update cycle. At this time, by mapping the priority score to a preset low score interval, the priority score of the application can be lowered, thereby limiting the permissions of the application and preventing the application from running in the background multiple times or for a long time.
[0129] In some embodiments, before determining the score adjustment direction and score adjustment range, the method further includes:
[0130] If the time difference is less than a fifth preset threshold, the background available time is reduced, wherein the fifth preset threshold is less than the first preset threshold.
[0131] Before determining the score adjustment direction and score adjustment range based on the difference in the total foreground running time and the total background running time, the difference in the time and the size of the first preset threshold and the fifth preset threshold are also judged. When the difference in the time is greater than the fifth preset threshold, the score adjustment direction and score adjustment range are determined. When the difference in the time is not greater than the fifth preset threshold, the background available time of the application within the score update cycle is reduced. Furthermore, the difference in the time is compared with the first preset threshold. When the difference in the time is greater than the first preset threshold, the score adjustment direction is determined to be the score increase direction, and the score adjustment range in the score increase direction is determined based on the difference in the time. When the difference in the time is not greater than the first preset threshold, the score adjustment direction is determined to be the score decrease direction, and the score adjustment range in the score decrease direction is determined based on the difference in the time.
[0132] In some embodiments, after mapping the priority score to a preset low score interval, the method further includes:
[0133] At the beginning of the next rating update cycle, the background availability time is restored to the preset availability time.
[0134] This embodiment also restores the background available time of the application at the beginning of a new rating update cycle, so as to update the background available time in real time according to the time the application runs in the background during the new rating update cycle.
[0135] The preset available time can be obtained by analyzing the historical background running time within the rating update cycle, or can be customized by the user. There are many specific setting methods, which are not limited here.
[0136] As can be seen from the above, the application interception method proposed in the embodiment of the present application can prioritize different applications according to their historical foreground running data and historical background running data, and then set a corresponding target interception strategy for the application according to the priority score, so that the application can be intercepted according to its corresponding target interception strategy when the application is started. In addition, during the operation of the application, the priority score of the application is updated according to the real-time foreground running data and the real-time background running data, and the corresponding target interception strategy is dynamically updated according to the updated priority score, so that the interception of the application is more timely and accurate, and in line with the actual operation of the application. Secondly, when updating the priority score, by comprehensively considering the foreground running frequency, background running frequency, total foreground running time, foreground running frequency, single foreground running time of each foreground run, background available time and other data of the application within the scoring update cycle, the priority score can be fine-tuned more quickly and accurately, thereby improving the rate of updating the priority score.
[0137] In one embodiment, an application interception device is also provided. Please refer to Figure 9, which is a schematic diagram of the structure of the application interception device 200 provided in an embodiment of the present application. The application interception device 200 is applied to an electronic device and includes:
[0138] The data acquisition module 210 is used to acquire the historical foreground running data and historical background running data of the application program;
[0139] Scoring module 220, used to score the priority of the application based on historical foreground running data and historical background running data to obtain a priority score;
[0140] The policy acquisition module 230 is used to determine a target interception policy for the application program based on the priority score.
[0141] In some embodiments, the scoring module 220 is further configured to:
[0142] The priority of the application is scored based on the historical foreground running data and its corresponding foreground weight, as well as the historical background running data and its corresponding background weight, to obtain a priority score, wherein the foreground weight is higher than the background weight.
[0143] In some embodiments, before determining a target interception strategy for an application based on the priority score, the data acquisition module 210 is further configured to:
[0144] Get the real-time foreground and background running data of the application;
[0145] The scoring module 220 is also used to:
[0146] Update the priority score based on real-time foreground operation data and real-time background operation data.
[0147] In some embodiments, the real-time foreground running data includes the total foreground running time and foreground running frequency of the application within the scoring update period, and the real-time background running data includes the total background running time and background running frequency of the application within the scoring update period. If the foreground running frequency is greater than the background running frequency, the scoring module 220 is further configured to:
[0148] Determine the direction and extent of score adjustment based on the difference between the total running time of the foreground and the total running time of the background;
[0149] Adjust the priority score according to the score adjustment amount in the score adjustment direction.
[0150] In some embodiments, the scoring module 220 is further configured to:
[0151] Determine whether the difference between the total foreground running time and the total background running time is greater than a first preset threshold;
[0152] If so, the score adjustment direction is determined to be the score improvement direction, and the score adjustment range in the score improvement direction is determined based on the time difference;
[0153] If not, the score adjustment direction is determined to be a downward score direction, and the score adjustment range in the downward score direction is determined based on the time difference.
[0154] In some embodiments, the real-time foreground running data also includes the preset single running time of the application within the score update cycle and the single foreground running time of each foreground run. Before determining the score adjustment range in the direction of improving the score based on the time difference, the scoring module 220 is further configured to:
[0155] Count the frequency of single runs with a foreground running time greater than the preset single running time;
[0156] Determine whether a first frequency difference between the single run frequency and the foreground run frequency is greater than a second preset threshold;
[0157] If so, the score adjustment range in the direction of improving the score is determined based on the first frequency difference and the duration difference;
[0158] If not, the score adjustment range in the direction of improving the score will be determined based on the difference in duration.
[0159] In some embodiments, the application program interception device 200 further includes an application control module.
[0160] After determining the score adjustment range in the direction of score reduction based on the duration difference, the application control module is used to:
[0161] Reduce the preset single run time based on the duration difference.
[0162] In some embodiments, before counting the frequency of single runs in which the foreground single run length is greater than a preset single run length, the application control module is further configured to:
[0163] When the single running time in the foreground exceeds the preset single running time, an application interception prompt is issued;
[0164] Obtaining a cancel interception operation in response to an application interception prompt;
[0165] determining whether the difference between the number of application interception prompts and the number of cancellation interception operations is greater than a third preset threshold;
[0166] If so, increase the preset single run time.
[0167] In some embodiments, the scoring module 220 is further configured to:
[0168] Determining whether a difference between the background running frequency and a second frequency of a preset background running frequency is greater than a fourth preset threshold;
[0169] If so, the score adjustment range in the direction of score reduction is determined based on the second frequency difference and duration difference;
[0170] If not, the score adjustment range in the direction of score reduction is determined based on the difference in duration.
[0171] In some embodiments, if the foreground running frequency is not greater than the background running frequency, the scoring module 220 is further configured to:
[0172] Determine the adjustment coefficient based on the difference between the total foreground running time and the total background running time;
[0173] The priority score is mapped to a preset low score interval according to the adjustment coefficient to update the priority score.
[0174] In some embodiments, the real-time background running data also includes the background availability time of the application within the score update cycle; before determining the score adjustment direction and score adjustment range based on the difference between the total foreground running time and the total background running time, the scoring module 220 is further configured to:
[0175] Calculate the proportion of the first duration in the total background running time to the background available time;
[0176] Calculate the proportion of the backend available time in the second time period during the rating update cycle;
[0177] Determine whether the first duration ratio is greater than the second duration ratio;
[0178] If so, the priority score is mapped to a preset low score interval;
[0179] If not, the score adjustment direction and score adjustment range are determined based on the difference between the total foreground running time and the total background running time.
[0180] In some embodiments, before determining the score adjustment direction and score adjustment range, the application control module is further configured to:
[0181] If the time difference is less than the fifth preset threshold, the background available time is reduced.
[0182] In some embodiments, after mapping the priority score to a preset low score interval, the application control module is further configured to:
[0183] At the beginning of the next rating update cycle, the background availability time is restored to the preset availability time.
[0184] It should be noted that the application interception device 200 provided in the embodiment of the present application and the application interception method in the above embodiment belong to the same concept. Any method provided in the application interception method embodiment can be implemented through the application interception device 200. The specific implementation process is detailed in the application interception method embodiment, which will not be repeated here.
[0185] As can be seen from the above, the application interception device 200 proposed in the embodiment of the present application can perform priority scoring for different applications according to their historical foreground running data and historical background running data, and then set a corresponding target interception strategy for the application according to the priority score, so as to intercept the application according to its corresponding target interception strategy when the application is started. In addition, during the operation of the application, the priority score of the application is updated according to the real-time foreground running data and the real-time background running data, and the corresponding target interception strategy is dynamically updated according to the updated priority score, so as to achieve more timely and accurate interception of the application, and in line with the actual operation of the application. Secondly, when updating the priority score, by comprehensively considering the foreground running frequency, background running frequency, total foreground running time, foreground running frequency, single foreground running time of each foreground run, background available time and other data of the application within the scoring update cycle, it is possible to fine-tune the priority score more quickly and accurately, thereby improving the rate of updating the priority score.
[0186] The embodiment of the present application also provides an electronic device, which may be a smart phone, tablet computer, PDA, desktop computer, smart screen, smart watch, etc. As shown in Figure 10, Figure 10 is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. The electronic device 300 includes a processor 310 with one or more processing cores, a memory 320 with one or more computer-readable storage media, and a computer program stored in the memory 320 and executable on the processor. The processor 310 is electrically connected to the memory 320. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.
[0187] The processor 310 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device 300. By running or loading software programs and / or modules stored in the memory 320 and calling data stored in the memory 320, it executes various functions of the electronic device 300 and processes data, thereby monitoring the electronic device 300 as a whole.
[0188] In the embodiment of the present application, the processor 310 in the electronic device 300 loads instructions corresponding to one or more application processes into the memory 320 according to the following steps, and the processor 310 runs the application stored in the memory 320 to implement various functions:
[0189] Get the historical foreground running data and historical background running data of the application;
[0190] Scoring the priority of the application based on historical foreground running data and historical background running data to obtain a priority score;
[0191] Determine the targeted blocking strategy for the application based on the priority score.
[0192] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0193] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0194] As can be seen from the above, the electronic device provided by this embodiment can prioritize different applications according to their historical foreground running data and historical background running data, and then set corresponding target interception strategies for the applications according to the priority scores, so that the applications can be intercepted according to their corresponding target interception strategies when the applications are started. In addition, during the application operation process, the priority score of the application is updated according to the real-time foreground running data and the real-time background running data, and the corresponding target interception strategy is dynamically updated according to the updated priority score, so that the interception of the application is more timely and accurate, and in line with the actual operation of the application. Secondly, when updating the priority score, by comprehensively considering the foreground running frequency, background running frequency, total foreground running time, foreground running frequency, single foreground running time of each foreground run, background available time and other data of the application within the scoring update cycle, the priority score can be fine-tuned more quickly and accurately, thereby improving the rate of updating the priority score.
[0195] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0196] To this end, the embodiments of the present application provide a computer-readable storage medium. Persons skilled in the art will appreciate that all or part of the steps in the above-described embodiment methods can be implemented by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. When executed, the program includes the following steps:
[0197] Get the historical foreground running data and historical background running data of the application;
[0198] Scoring the priority of the application based on historical foreground running data and historical background running data to obtain a priority score;
[0199] Determine the targeted blocking strategy for the application based on the priority score.
[0200] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0201] The above-mentioned storage medium may be ROM / RAM, a magnetic disk, an optical disk, etc. Since the computer program stored in the storage medium can execute the steps of any of the application program interception methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the application program interception methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0202] The above is a detailed introduction to the interception method, device, storage medium and electronic device for an application provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for intercepting an application program. in, The method comprises: Get the historical foreground running data and historical background running data of the application; Scoring the priority of the application program according to the historical foreground running data and the historical background running data to obtain a priority score; A target interception strategy for the application is determined based on the priority score.
2. The method for intercepting an application according to claim 1, in, Scoring the priority of the application program according to the historical foreground running data and the historical background running data to obtain a priority score includes: The priority of the application is scored based on the historical foreground running data and its corresponding foreground weight, as well as the historical background running data and its corresponding background weight, to obtain the priority score, wherein the foreground weight is higher than the background weight.
3. The method for intercepting an application according to claim 1, in, Before determining the target interception strategy for the application according to the priority score, the method further includes: Obtaining real-time foreground running data and real-time background running data of the application; The priority score is updated according to the real-time foreground operation data and the real-time background operation data.
4. The method for intercepting an application according to claim 3, in, The real-time foreground running data includes the total foreground running time and the foreground running frequency of the application program in the score update cycle, and the real-time background running data includes the total background running time and the background running frequency of the application program in the score update cycle. If the foreground running frequency is greater than the background running frequency, updating the priority score according to the real-time foreground running data and the real-time background running data includes: Determine the score adjustment direction and score adjustment range according to the difference between the total foreground running time and the total background running time; The priority score is adjusted in the score adjustment direction according to the score adjustment magnitude.
5. The method for intercepting an application according to claim 4, in, Determining the score adjustment direction and score adjustment range according to the difference between the total duration of the foreground operation and the total duration of the background operation includes: Determine whether the difference between the total duration of the foreground operation and the total duration of the background operation is greater than a first preset threshold; If yes, determine that the score adjustment direction is a score improvement direction, and determine the score adjustment range in the score improvement direction according to the duration difference; If not, it is determined that the score adjustment direction is a score reduction direction, and the score adjustment amplitude in the score reduction direction is determined according to the duration difference.
6. The method for intercepting an application according to claim 4, in, The real-time foreground operation data also includes the preset single operation duration of the application program in the score update cycle and the single operation duration of the foreground operation each time, and before determining the score adjustment range in the score improvement direction according to the duration difference, it also includes: Counting the frequency of single operations in which the foreground single operation duration is greater than the preset single operation duration; Determine whether a first frequency difference between the single operation frequency and the foreground operation frequency is greater than a second preset threshold; If yes, determining the score adjustment range in the score improvement direction according to the first frequency difference and the duration difference; If not, the score adjustment range in the direction of improving the score is determined according to the time difference.
7. The method for intercepting an application according to claim 6, in, After determining the score adjustment range in the score reduction direction according to the duration difference, the method further includes: The preset single operation duration is reduced according to the duration difference.
8. The method for intercepting an application according to claim 6, in, Before counting the single operation frequency of the foreground single operation length being greater than the preset single operation length, the method further includes: When the single foreground running time is longer than the preset single running time, an application interception prompt is given; Acquire a cancel interception operation in response to the application interception prompt; Determining whether the difference between the number of application interception prompts and the number of cancel interception operations is greater than a third preset threshold; If so, increase the preset single running time.
9. The method for intercepting an application according to claim 5, in, The step of determining the score adjustment range in the score reduction direction according to the time difference includes: Determine whether a second frequency difference between the background running frequency and a preset background running frequency is greater than a fourth preset threshold; If yes, determining the score adjustment range in the score reduction direction according to the second frequency difference and the duration difference; If not, the score adjustment range in the score reduction direction is determined according to the duration difference.
10. The method for intercepting an application according to claim 4, in, If the foreground running frequency is not greater than the background running frequency, updating the priority score according to the real-time foreground running data and the real-time background running data includes: Determine an adjustment coefficient according to the difference between the total duration of the foreground operation and the total duration of the background operation; The priority score is mapped to a preset low score interval according to the adjustment coefficient to update the priority score.
11. The method for intercepting an application according to claim 4, in, The real-time background operation data also includes the background availability time of the application program within the rating update cycle; Before determining the score adjustment direction and score adjustment range according to the difference between the total duration of the foreground operation and the total duration of the background operation, the method further includes: Calculate the proportion of the first duration in the total background running duration in the background available duration; Calculate the proportion of the second duration of the background available duration in the rating update cycle; Determine whether the first duration ratio is greater than the second duration ratio; If so, mapping the priority score to a preset low score interval; If not, the score adjustment direction and score adjustment range are determined according to the difference between the total duration of the foreground operation and the total duration of the background operation.
12. The method for intercepting an application according to claim 11, in, Before determining the score adjustment direction and score adjustment range, the following steps are also included: If the duration difference is smaller than a fifth preset threshold, the background available duration is reduced, wherein the fifth preset threshold is smaller than the first preset threshold.
13. The method for intercepting an application according to claim 11, in, After mapping the priority score to a preset low score interval, the method further includes: At the beginning of the next rating update cycle, the background available time is restored to the preset available time.
14. An application interception device, in, include: The data acquisition module is used to obtain the historical foreground running data and historical background running data of the application; A scoring module, used to score the priority of the application according to the historical foreground operation data and the historical background operation data to obtain a priority score; A policy acquisition module is used to determine a target interception policy for the application program according to the priority score.
15. The application interception device according to claim 14, in, The scoring module is used to: The priority of the application is scored based on the historical foreground running data and its corresponding foreground weight, as well as the historical background running data and its corresponding background weight, to obtain the priority score, wherein the foreground weight is higher than the background weight.
16. The application interception device according to claim 14, in, The strategy acquisition module is used for: Obtaining real-time foreground running data and real-time background running data of the application; updating the priority score according to the real-time foreground operation data and the real-time background operation data; The real-time foreground operation data includes the total foreground operation time and the foreground operation frequency of the application program in the score update cycle, and the real-time background operation data includes the total background operation time and the background operation frequency of the application program in the score update cycle. If the foreground operation frequency is greater than the background operation frequency, the policy acquisition module is further used to: Determine the score adjustment direction and score adjustment range according to the difference between the total foreground running time and the total background running time; The priority score is adjusted in the score adjustment direction according to the score adjustment magnitude.
17. The application interception device according to claim 16, in, The strategy acquisition module is used for: Determine whether the difference between the total duration of the foreground operation and the total duration of the background operation is greater than a first preset threshold; If yes, determine that the score adjustment direction is a score improvement direction, and determine the score adjustment range in the score improvement direction according to the duration difference; If not, it is determined that the score adjustment direction is a score reduction direction, and the score adjustment amplitude in the score reduction direction is determined according to the duration difference.
18. The application interception device according to claim 16, in, The strategy acquisition module is used for: Counting the frequency of single operations in which the foreground single operation duration is greater than the preset single operation duration; Determine whether a first frequency difference between the single operation frequency and the foreground operation frequency is greater than a second preset threshold; If yes, determining the score adjustment range in the score improvement direction according to the first frequency difference and the duration difference; If not, the score adjustment range in the direction of improving the score is determined according to the time difference.
19. A computer-readable storage medium having a computer program stored thereon, in, When the computer program is executed on a computer, the computer is enabled to execute the method for intercepting an application program according to any one of claims 1 to 13.
20. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, in, The processor is used to execute the application program interception method as described in any one of claims 1 to 13 by calling the computer program.
Citation Information
Patent Citations
Application program control method, application program control device, storage medium and electronic device
CN107423127A
Application cleaning method, mobile terminal and computer readable storage medium
CN107844333A
Application control method and device, electronic equipment and computer readable medium
CN111045809A
Application program intercepting method and device, storage medium and electronic equipment
CN117407075A
