A processing method and system for cleaning vehicle system applications
By calculating the affinity attribute values and memory usage data of applications in the vehicle-computer system, we optimize the application cleanup strategy to avoid accidentally killing dependency applications. This solves the problem of the application cleanup strategy in the vehicle-computer system accidentally killing middleware processes, and improves system fluency and response. speed.
Patent Information
- Application Number
- CN202410963569.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-18
AI Technical Summary
The application cleaning strategy of the existing car-machine system can easily accidentally kill middleware processes with dependencies, resulting in delayed loading of some application scenes and even an unsmooth experience.
By calculating the affinity attribute value of each running application, the applications are sorted and cleaned according to their dependencies and memory usage data size to avoid directly cleaning up dependent applications and optimize the memory release strategy.
It reduces application loading delay time, improves system response speed and operation fluency, and ensures that important applications and user activity applications receive more resources.
Smart Images

Figure CN118519704B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile technology, and in particular to a processing method and system for cleaning up vehicle system applications. Background Art
[0002] With the rapid development of automobile technology, users have higher and higher requirements for the smoothness of the car system. The existing application cleaning strategy for the running memory of the car system is based on the native Linux system to screen the insufficient memory scores of different applications and the memory occupied data size of the applications.
[0003] When the remaining memory space of the vehicle system is lower than the preset value, the Linux system will traverse all applications and search for the applications with the highest insufficient memory score and the largest memory usage data for cleaning. However, when the system triggers application cleaning at a relatively high frequency, the above application cleaning strategy will mistakenly kill the middleware process with dependencies, resulting in delays in loading some application scenes, and even problems such as unsmooth experience. Therefore, there is room for improvement. Summary of the invention
[0004] In view of the shortcomings of the prior art mentioned above, the purpose of the present invention is to provide a method and system for cleaning up vehicle system applications, which improves the problem that the application cleaning strategy of the existing vehicle system may mistakenly kill middleware processes with dependencies, resulting in delayed loading of some application scenarios and even an unsmooth experience.
[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0006] The present invention provides a method for cleaning up vehicle system applications, comprising:
[0007] Get the initial remaining memory space of the vehicle system;
[0008] When the initial memory remaining space is less than the preset remaining space, obtaining all running applications in the vehicle system;
[0009] Calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications;
[0010] Sorting all the running applications according to the affinity attribute values, obtaining the running applications whose affinity values are smaller than a preset affinity value, and indicating them as applications to be cleaned up;
[0011] Obtaining insufficient memory scores of the applications to be cleaned up, and sorting all the applications to be cleaned up according to the insufficient memory scores;
[0012] Acquire the to-be-cleaned application whose insufficient memory score is greater than a preset score, and indicate it as a first determined-to-clean application;
[0013] Memory occupancy data of the first determined-to-be-cleaned applications is obtained, and application cleaning processing is performed on all the first determined-to-be-cleaned applications in sequence according to the size of the memory occupancy data.
[0014] In one embodiment of the present invention, before executing the step of acquiring all running applications in the vehicle system when the initial memory remaining space is less than the preset remaining space, the method further includes:
[0015] Determine whether the initial memory remaining space is less than the preset remaining space;
[0016] If the initial memory remaining space is greater than or equal to the preset remaining space, a new initial memory remaining space is periodically acquired, and the determination is repeated until the new initial memory remaining space is less than the preset remaining space.
[0017] In one embodiment of the present invention, in the step of calculating the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications, the affinity attribute value X i Satisfy the formula:
[0018] X i =a*b+c*d;
[0019] Among them, X i represents the affinity attribute value of the i-th running application, a represents the number of other running applications that have a strong dependency relationship with the current running application, b represents the affinity preset value between two running applications with a strong dependency, c represents the number of other running applications that have a weak dependency relationship with the current running application, d represents the affinity preset value between two running applications with a weak dependency, and * represents the product symbol.
[0020] In one embodiment of the present invention, when there is a dependency relationship between two running applications,
[0021] The strong dependency relationship between the two running applications is represented by: when one of the running applications is in a non-running state, the other running application cannot run independently;
[0022] The weak dependency relationship between the two running applications is represented by: when one of the running applications is not running, the other running application can run independently.
[0023] In one embodiment of the present invention, after the step of obtaining the memory usage data of the first determined cleaning application and performing application cleaning processing on all the first determined cleaning applications in sequence according to the size of the memory usage data, the method further includes:
[0024] Obtaining the remaining memory space of the vehicle system;
[0025] When the remaining space of the new memory is less than the remaining space of the initial memory, obtaining the applications to be cleaned up and other running applications in the vehicle system;
[0026] According to the dependency relationship between each running application and other running applications, obtaining at least one process group, wherein the process group includes a plurality of the running applications having a dependency relationship with each other;
[0027] Calculating the weighted average affinity of each process group and the weighted average affinity of the application to be cleaned up respectively;
[0028] Sorting the process groups and the to-be-cleaned applications according to the affinity weighted average values, obtaining the to-be-cleaned applications and process groups that are greater than a preset weighted average value, and representing them as the second determined to-be-cleaned applications and the second determined to-be-cleaned process groups, respectively;
[0029] Memory occupancy data of the second determined cleanup application and the second determined cleanup process group are obtained, and application cleaning processing is performed on the second determined cleanup application and the second determined cleanup process group in sequence according to the size of the memory occupancy data to generate intermediate memory remaining space of the vehicle system.
[0030] In one embodiment of the present invention, before executing the step of obtaining the applications to be cleaned up and other running applications in the vehicle system when the remaining space of the new memory is less than the remaining space of the initial memory, the step further includes:
[0031] Determine whether the new memory remaining space is less than the initial memory remaining space;
[0032] If the new memory remaining space is greater than or equal to the initial memory remaining space, the new memory remaining space is periodically acquired, and the determination is repeated until the acquired new memory remaining space is less than the initial memory remaining space.
[0033] In one embodiment of the present invention, the step of respectively calculating the weighted average affinity of each process group and the weighted average affinity of the application to be cleaned up comprises:
[0034] Summing the affinity attribute values and insufficient memory scores of all running applications in the process group to generate a total affinity attribute value and a total insufficient memory score;
[0035] Performing weighted average processing on the total value of the affinity attribute of the process group and the total score of the insufficient memory to generate a weighted average value of the affinity of the process group;
[0036] The insufficient memory scores of the applications to be cleaned up are obtained and expressed as the affinity weighted average of the applications to be cleaned up.
[0037] In one embodiment of the present invention, in the step of performing weighted average processing on the affinity attribute total value of the process group and the insufficient memory total score to generate the affinity weighted average value of the process group, the affinity attribute total value 、Total score of insufficient memory and the affinity weighted average Satisfy the formulas respectively:
[0038]
[0039]
[0040] ;
[0041] in, It is expressed as the total value of the affinity attribute of the process group. Expressed as the total out-of-memory score for the process group. Expressed as the weighted average of the affinity of the process group, Represents the affinity attribute value of the nth running application in the process group. It is expressed as the memory shortage score of the nth running application in the process group. It is expressed as the weight value of the total value of affinity attribute. Expressed as the weight of the total out-of-memory score, , Represented as the number of running applications in the process group.
[0042] In one embodiment of the present invention, after obtaining the memory occupancy data of the second determined cleaning application and the second determined cleaning process group, and sequentially performing application cleaning processing on the second determined cleaning application and the second determined cleaning process group according to the size of the memory occupancy data, and generating the intermediate memory remaining space of the vehicle system, the method further includes:
[0043] When the remaining space of the intermediate memory is less than the remaining space of the new memory, obtaining the process groups in the vehicle system and their corresponding affinity weighted average values;
[0044] The process groups are sorted according to the size of the affinity weighted average value, and the process groups whose affinity weighted average value is smaller than the preset weighted average value are obtained, and a cleanup process is applied to them.
[0045] The present invention also provides a processing system for cleaning up vehicle system applications, comprising:
[0046] A memory acquisition module is used to obtain the initial remaining memory space of the vehicle system;
[0047] A memory comparison module, used for obtaining all running applications in the vehicle system when the initial memory remaining space is less than the preset remaining space;
[0048] An affinity attribute calculation module, used to calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications;
[0049] An initial screening module, used to sort all the running applications according to the affinity attribute values, obtain the running applications whose affinity values are smaller than a preset affinity value, and indicate them as applications to be cleaned up;
[0050] a target screening module, used for obtaining the insufficient memory scores of the applications to be cleaned up, and sorting all the applications to be cleaned up according to the insufficient memory scores;
[0051] The target screening module is further used to obtain the to-be-cleaned applications whose insufficient memory scores are greater than a preset score, and represent them as first determined cleaning applications;
[0052] The application cleaning module is used to obtain the memory occupancy data of the first determined cleaning applications, and perform application cleaning processing on all the first determined cleaning applications in sequence according to the size of the memory occupancy data.
[0053] As described above, the present invention provides a method and system for cleaning up vehicle system applications. By first calculating the affinity attribute value of each running application and grouping the running applications according to the affinity attribute value, it is possible to separate dependent process groups from single applications without dependencies, avoid directly cleaning up dependent applications, reduce the delay time of application loading, and thus improve the response speed of the system and the smoothness of operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0055] Figure 1 It is a flowchart of a method for cleaning up vehicle system applications in one embodiment of the present invention;
[0056] Figure 2 In one embodiment of the present invention Figure 1 A schematic diagram of the process flow of the steps before step S20;
[0057] Figure 3 In one embodiment of the present invention Figure 1 A schematic diagram of the process of steps after step S70;
[0058] Figure 4 In one embodiment of the present invention Figure 3 Schematic diagram of the process of the steps before step S82;
[0059] Figure 5 In one embodiment of the present invention Figure 3 Schematic diagram of the process of step S84;
[0060] Figure 6 In one embodiment of the present invention Figure 3 Schematic diagram of the process of steps after step S86;
[0061] Figure 7 It is a structural schematic diagram of a processing system for cleaning up vehicle system applications in one embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] The present invention proposes a processing method and system for cleaning up vehicle system applications, which relate to the field of automotive technology and can be specifically applied to real-time application cleaning of vehicle systems. It can avoid directly cleaning up intermediate processes that have a dependency relationship with the main application, thereby improving the fluency of the vehicle system and reducing the application loading delay time.
[0064] See also Figure 1 , Figure 1 A flowchart of a method for cleaning up vehicle system applications provided by the present invention is shown in FIG. In one embodiment of the present invention, the method for cleaning up vehicle system applications may include the following steps.
[0065] Step S10: Obtain the initial remaining memory space of the vehicle system.
[0066] Step S20: When the initial remaining memory space is less than the preset remaining space, all running applications in the vehicle system are obtained.
[0067] Step S30: Calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications.
[0068] Step S40: sort all running applications according to the affinity attribute values, obtain running applications with affinity values less than a preset value, and indicate them as applications to be cleaned up.
[0069] Step S50: Obtain the insufficient memory scores of the applications to be cleaned up, and sort all the applications to be cleaned up according to the insufficient memory scores.
[0070] Step S60: Obtain an application to be cleaned up whose insufficient memory score is greater than a preset score, and indicate it as a first determined cleanup application.
[0071] Step S70: Obtain memory usage data of the first determined cleaning application, and perform application cleaning processing on all the first determined cleaning applications in sequence according to the size of the memory usage data.
[0072] See also Figure 1 In one embodiment of the present invention, when step S10 is executed, the initial remaining memory space of the vehicle system is obtained. Specifically, the car can be powered on first, and the instrument system of the car can be started first, the vehicle system can be started normally, and the running memory allocated to the vehicle system is only 8GB. That is, the vehicle system can be directly in a low-memory running state after being turned on as an example. After the vehicle system is turned on, the user can operate the central control screen for a moment in the cockpit and open multiple vehicle applications. At this time, the initial remaining memory space of the vehicle system can be obtained.
[0073] See also Figure 2 In one embodiment of the present invention, when executing step S20, specifically, before executing step S20, the following steps are also included, which are described in detail as follows.
[0074] Step S21, determining whether the initial memory remaining space is less than the preset remaining space.
[0075] Step S22: If the initial memory remaining space is greater than or equal to the preset remaining space, periodically obtain a new initial memory remaining space, and repeat the judgment until the new initial memory remaining space is less than the preset remaining space.
[0076] In one embodiment of the present invention, when executing step S21 to step S22, specifically, the preset remaining space can be set to 4GB, or 2GB, or other values. That is, as long as the preset remaining space is within a reasonable range, it can ensure that the vehicle system can still operate normally. When the initial memory remaining space is less than the preset remaining space, all running application processes in the vehicle system can be obtained and represented as running applications.
[0077] However, it is not limited to this. When the initial memory remaining space is greater than or equal to the preset remaining space, that is, the initial memory remaining space is greater than or equal to the preset remaining space, it means that the vehicle system has not reached the cleaning threshold limit. At this time, the vehicle system is in normal operation. To ensure that the remaining memory space of the vehicle system can be monitored in real time, it can be set to periodically obtain a new initial memory remaining space and repeat the judgment until the initial memory remaining space is less than the preset remaining space. For example, it can be set to obtain a new initial memory remaining space every 120 seconds.
[0078] See also Figure 1 In one embodiment of the present invention, when executing step S30, the affinity attribute value of each running application is calculated according to the dependency relationship between each running application and other running applications. Specifically, in the step of calculating the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications, the affinity attribute value X i Satisfies the following formula:
[0079] X i =a*b+c*d,
[0080] Among them, X i represents the affinity attribute value of the i-th running application, a represents the number of other running applications that have a strong dependency relationship with the current running application, b represents the affinity preset value between two running applications with a strong dependency, c represents the number of other running applications that have a weak dependency relationship with the current running application, d represents the affinity preset value between two running applications with a weak dependency, and * represents the product symbol.
[0081] Furthermore, when there is a dependency relationship between two running applications, the strong dependency relationship between the two running applications is represented by: when one running application is not running, the other running application cannot run independently. The weak dependency relationship between the two running applications is represented by: when one running application is not running, the other running application can run independently. However, it is not limited to this. When there is a running application that can run completely independently and the running application has no connection with other running applications, the running application can be defined as a non-dependency application, and the affinity attribute value of the non-dependency application can be 0.
[0082] For example, six running applications may be set in the vehicle system, and they are a foreground main application A and five intermediate sub-applications B, C, D, E, and F. Among them, A and B and C may have strong dependencies, A and D and E may have weak dependencies, and A and F have no dependency. B and D and F may have weak dependencies. In this scenario, the affinity preset value between two running applications with strong dependencies can be set to 80, and the affinity preset value between two running applications with weak dependencies can be set to 20. The affinity preset value between two running applications with strong dependencies can also be set to 70, and the affinity preset value between two running applications with weak dependencies can be set to 30. However, it is not limited to this, and the affinity preset value between two running applications with strong dependencies or weak dependencies can also be set to other values, as long as the sum of the affinity preset value with strong dependency and the affinity preset value with weak dependency of the same running application is 100.
[0083] Specifically, the preset value of the strong dependency affinity between A and B can be set to 80, the preset value of the strong dependency affinity between A and C can also be set to 80, the preset value of the weak dependency affinity between A and D can be set to 20, and the preset value of the weak dependency affinity between A and E can also be set to 20, then the affinity attribute value of A can be A=2*80+2*20=200. The preset value of the weak dependency affinity between B and D can be set to 20, and the preset value of the weak dependency affinity between B and F can also be set to 20, then the affinity attribute value of B can be B=1*80+2*20=120. The affinity attribute value of C can be C=1*80, the affinity attribute value of D can be D=1*20+*20=40, and the affinity attribute values of E and F can be 20 respectively. Therefore, the six running applications AF in the vehicle system can be a process group, and the total affinity attribute value of the process group is A+B+C+D+E+F=460.
[0084] See also Figure 1In one embodiment of the present invention, when executing step S40, that is, all running applications are sorted according to the size of the affinity attribute value, and the running applications with a value less than the preset affinity value are obtained, and they are represented as applications to be cleaned. Specifically, all running applications can be sorted from large to small according to the affinity attribute value corresponding to each running application. However, it is not limited to this, and all running applications can also be sorted from small to large according to the affinity attribute value corresponding to each running application. Obtaining running applications with a value less than the preset affinity value and representing them as applications to be cleaned means that after all running applications are sorted according to the affinity attribute value, running applications with an affinity attribute value less than the preset affinity value can be screened out and represented as applications to be cleaned, that is, the dependency of the application to be cleaned is weak or has no dependency, so that it can be cleaned up first, thereby ensuring the fluency of the vehicle system after cleaning, while avoiding the delay in subsequent application loading due to cleaning of running applications with strong dependencies.
[0085] For example, the preset affinity value can be set to 10, that is, the running applications with affinity attribute values less than 10 indicate that their dependencies are weak or have no dependencies. Therefore, after all the running applications are sorted from large to small according to the affinity attribute values corresponding to each running application, all the running applications with affinity attribute values less than 10 can be indicated as applications to be cleaned up.
[0086] See also Figure 1 In one embodiment of the present invention, when executing step S50, specifically, after obtaining the application to be cleaned up, the OutOfMemory Adjust (OOMADJ) score corresponding to the application to be cleaned up can be obtained, and all the applications to be cleaned up can be sorted according to the size of the insufficient memory score. Among them, the OOMADJ score is a parameter used to indicate the priority of the application in the Android operating system, which is part of the Low Memory Killer (LMK) strategy. The insufficient memory score determines the priority of the application to be killed when the system is short of memory. The lower the insufficient memory score, the more important the corresponding application is, and the less willing the system is to kill the application under memory pressure. Conversely, the higher the insufficient memory score, the lower the priority of the corresponding application, and the greater the possibility that the process will be killed when the system needs to release memory.
[0087] Further, sorting all applications to be cleaned up according to the insufficient memory scores may include but is not limited to sorting all applications to be cleaned up from large to small according to the insufficient memory scores, or sorting all applications to be cleaned up from small to large according to the insufficient memory scores.
[0088] See also Figure 1 In one embodiment of the present invention, when executing step S60, specifically, obtaining the to-be-cleaned applications whose insufficient memory scores are greater than the preset scores and representing them as the first determined to-be-cleaned applications means that after all the to-be-cleaned applications are sorted, it is possible to determine whether the insufficient memory scores of the to-be-cleaned applications are greater than the preset scores to determine the to-be-cleaned applications that need to be cleaned, and represent them as the first determined to-be-cleaned applications. For example, in one embodiment of the present invention, the preset score can be set to 600, that is, when the insufficient memory score of the to-be-cleaned application is greater than 600, the to-be-cleaned application is the application that needs to be cleaned, and is represented as the first determined to-be-cleaned application. When the insufficient memory score of the to-be-cleaned application is less than or equal to 600, the to-be-cleaned application is retained.
[0089] See also Figure 1 In one embodiment of the present invention, when executing step S70, specifically, after obtaining multiple first determined cleaning applications, the memory usage data of the first determined cleaning applications can continue to be obtained, and the multiple first determined cleaning applications can be sorted according to the size of the memory usage data. Finally, all the first determined cleaning applications are sequentially cleaned according to the sorting to achieve application cleaning of the vehicle system, and the intermediate processes that have a dependency relationship with the main application can be directly cleaned, thereby improving the fluency of the vehicle system and reducing the application loading delay time.
[0090] Among them, the first thing to determine is the memory usage data (Resident Set Size, RSS) of the cleaned application, which refers to the actual memory size currently occupied by an application in the main memory, which does not include those pages that have been swapped out or only exist on the disk. For example, if the RSS value of an application is very high, it may mean that it is the main consumer of memory usage, which may cause other applications to have less physical memory available, and even trigger system memory pressure and swap activities, thereby affecting system performance.
[0091] See also Figure 1 and Figure 3 In one embodiment of the present invention, after executing step S70, the processing method for cleaning up vehicle system applications may further include steps S81 to S86.
[0092] Step S81, obtaining the new remaining memory space of the vehicle system.
[0093] Step S82: when the remaining space of the new memory is less than the remaining space of the initial memory, obtain the applications to be cleaned up and other running applications in the vehicle system.
[0094] Step S83: According to the dependency relationship between each running application and other running applications, at least one process group is obtained, wherein the process group includes multiple running applications having a dependency relationship with each other.
[0095] Step S84: Calculate the weighted average affinity of each process group and the weighted average affinity of the application to be cleaned up respectively.
[0096] Step S85: sort the process groups and to-be-cleaned applications according to the affinity weighted average values, obtain to-be-cleaned applications and process groups that are greater than the preset weighted average values, and represent them as the second determined to-be-cleaned applications and the second determined to-be-cleaned process groups, respectively.
[0097] Step S86, obtaining memory occupancy data of the second determined cleaning application and the second determined cleaning process group, and performing application cleaning processing on the second determined cleaning application and the second determined cleaning process group in sequence according to the size of the memory occupancy data, to generate intermediate memory remaining space of the vehicle system.
[0098] See also Figure 1 and Figure 3 In one embodiment of the present invention, when step S81 is executed, specifically, when step S70 is executed, multiple first determined cleaning applications can be obtained, and they are cleaned up in sequence according to the order of the corresponding memory occupancy data. When all the first determined cleaning applications are cleaned up, the new remaining memory space of the vehicle system can be obtained.
[0099] See also Figure 3 and Figure 4 In one embodiment of the present invention, before executing step 82, that is, before executing the step of obtaining the applications to be cleaned up and other running applications in the vehicle system when the remaining space in the new memory is less than the remaining space in the initial memory, steps S821 to S822 may be included, which are described in detail as follows.
[0100] Step S821, determine whether the new memory remaining space is smaller than the initial memory remaining space.
[0101] Step S822: If the new memory remaining space is greater than or equal to the initial memory remaining space, the new memory remaining space is periodically obtained, and the judgment is repeated until the obtained new memory remaining space is less than the initial memory remaining space.
[0102] In one embodiment of the present invention, when executing step S821 to step S822, specifically, after obtaining the new remaining memory space of the vehicle system, it can be determined whether the new remaining memory space is less than the initial remaining memory space. If the new remaining memory space is less than the initial remaining memory space, it means that even if the vehicle system is cleaned up, the memory level of the vehicle system will still gradually decrease under the normal operation of other applications. At this time, it is necessary to continue to obtain other remaining applications to be cleaned up and the remaining running applications that have not been cleaned up in the vehicle system.
[0103] However, it is not limited to this. When the new memory remaining space is not less than the initial memory remaining space, it means that the memory remaining space of the vehicle system after the previous application cleaning is greater than or equal to the initial memory remaining space, indicating that the first-stage cleaning strategy is effective. The first-stage application cleaning strategy can be continued, and the new memory remaining space of the vehicle system can be periodically obtained and the judgment is repeated until the new memory remaining space obtained is less than the initial memory remaining space.
[0104] See also Figure 1 and Figure 3 In one embodiment of the present invention, when executing step S83, specifically, obtaining at least one process group according to the dependency relationship between each remaining running application and other running applications means that the obtained remaining running applications that have not been cleaned up can be grouped according to the dependency relationship, that is, multiple running applications that have dependencies on each other can be grouped together to form a process group. Therefore, when the remaining running applications that have not been cleaned up are grouped according to the dependency relationship, at least one process group can be obtained. Among them, the process group can include multiple running applications that have dependencies on each other.
[0105] See also Figure 3 and Figure 5 In one embodiment of the present invention, when executing step S84, specifically, step S84 may include steps S841 to S843, which are described in detail as follows.
[0106] Step S841: sum the affinity attribute values and insufficient memory scores of all running applications in the process group to generate a total affinity attribute value and a total insufficient memory score.
[0107] Step S842: Perform weighted averaging on the total affinity attribute value and the insufficient memory total score of the process group to generate a weighted average affinity value of the process group.
[0108] Step S843: Obtain the insufficient memory scores of the applications to be cleaned up, and express them as the affinity weighted average of the applications to be cleaned up.
[0109] In one embodiment of the present invention, when executing step S831, specifically, the affinity attribute values and the insufficient memory scores of all applications in each process group obtained by grouping can be summed up to obtain the total affinity attribute value and the total insufficient memory score. The total affinity attribute value of each process group is the sum of the affinity attribute values of all applications in the process group, and the total insufficient memory score of each process group is the sum of the insufficient memory scores of all applications in the process group.
[0110] In one embodiment of the present invention, when executing step S842, specifically, in the step of performing weighted average processing on the total affinity attribute value of the process group and the total memory shortage score to generate the weighted average affinity value of the process group, the total affinity attribute value 、Total score of insufficient memory and affinity weighted average Satisfy the following formulas respectively,
[0111]
[0112]
[0113]
[0114] in, Represented as the total value of the affinity attribute of the process group, Expressed as the total out-of-memory score for the process group, Expressed as the weighted average of the affinity of the process group, Represents the affinity attribute value of the nth running application in the process group. It is expressed as the memory shortage score of the nth running application in the process group. It is expressed as the weight value of the total value of affinity attribute. Expressed as the weight of the total out-of-memory score, , Represented as the number of running applications in the process group.
[0115] In one embodiment of the present invention, when executing step S843, specifically, the insufficient memory score of the application to be cleaned up obtained refers to the application to be cleaned up whose insufficient memory score in step S60 is less than or equal to the preset score. Therefore, the application to be cleaned up cannot be grouped according to the dependency relationship, and the insufficient memory score of the application to be cleaned up can be expressed as the affinity weighted average of the application to be cleaned up.
[0116] See also Figure 1 and Figure 3In one embodiment of the present invention, when executing step S85, specifically, sorting the process groups and the applications to be cleaned up according to the size of the affinity weighted average value means sorting the corresponding process groups and the applications to be cleaned up from large to small according to the affinity weighted average value.
[0117] However, the present invention is not limited thereto, and the corresponding process groups and the applications to be cleaned may be sorted from small to large according to the affinity weighted average value. When the sorting is completed, the applications to be cleaned and the process groups may be screened according to the preset weighted average value to obtain the applications to be cleaned and the process groups whose affinity weighted average value is greater than the preset weighted average value, and the applications to be cleaned and the process groups may be represented as the second determined cleaning applications and the second determined cleaning process groups.
[0118] Specifically, the preset weighted average value can be set to 300, 400, or other values. The larger the affinity weighted average value corresponding to the application or process group to be cleaned, the more memory resources the corresponding application or process group to be cleaned occupies. By screening the applications and process groups to be cleaned that are larger than the preset weighted average value and cleaning them, it can ensure that important applications and currently active applications of users get more resources, thereby improving the response speed of the system, ensuring that system resources are preferentially allocated to key applications, and ensuring their stable operation.
[0119] See also Figure 1 and Figure 3 In one embodiment of the present invention, when executing step S86, specifically, after the second determined cleaning application and the second determined cleaning process group are determined, the corresponding memory occupancy data can be obtained, and the second determined cleaning application and the second determined cleaning process group can be sorted from large to small according to the memory occupancy data, and the application cleaning process is performed in sequence to obtain the remaining space of the intermediate memory of the vehicle system.
[0120] See also Figure 3 and Figure 6 In one embodiment of the present invention, after step S86, the processing method for cleaning up vehicle system applications may further include the following steps.
[0121] Step S91: When the remaining space of the intermediate memory is less than the remaining space of the new memory, obtain the process groups in the vehicle system and their corresponding affinity weighted average values.
[0122] Step S92: sort the process groups according to the size of the affinity weighted average value, obtain the process groups whose affinity weighted average value is smaller than the preset weighted average value, and perform application cleanup processing on them.
[0123] See also Figure 3 and Figure 6In one embodiment of the present invention, after executing steps S81 to S86, the remaining memory space of the vehicle system can be obtained and represented as the intermediate memory remaining space. Subsequently, when executing step S91, specifically, the size of the intermediate memory remaining space and the new memory remaining space can be compared. If the intermediate memory remaining space is greater than or equal to the new memory remaining space, it means that the cleaning strategy of the stage from step S81 to step S85 is effective, and the cleaning strategy of this stage can be maintained, and the remaining memory space of the vehicle system can be periodically obtained, and the judgment is repeated until the intermediate memory remaining space is less than the new memory remaining space.
[0124] Furthermore, when the remaining space of the intermediate memory is less than the remaining space of the new memory, it means that the cleaning strategy of step S81 to step S85 is still insufficient to release enough memory space. At this time, it is necessary to further obtain all the remaining process groups in the vehicle system and their corresponding affinity weighted average values. Among them, since the calculation method of the affinity weighted average value corresponding to all the remaining process groups is the same as the calculation method of the affinity weighted average value of the second determined cleaning group, it will not be repeated.
[0125] See also Figure 3 and Figure 6 In one embodiment of the present invention, when executing step S92, all remaining process groups may be sorted from large to small according to the affinity weighted average value. However, the present invention is not limited thereto, and all remaining process groups may be sorted from small to large according to the affinity weighted average value. Subsequently, the process groups whose affinity weighted average value is less than the preset weighted average value may be obtained, and the application cleaning process may be directly performed on them.
[0126] Specifically, the preset weighted average value is the same as the preset weighted average value in step S85, and the preset weighted average value can be set to 300, 400, or other values. Among them, by screening and cleaning all the remaining process groups, the application groups that occupy a large number of resources in the vehicle system can be cleaned up to the greatest extent, thereby further freeing up the vehicle system space and improving the fluency of the vehicle system.
[0127] However, it is not limited to this. In another embodiment of the present invention, when the remaining space of the intermediate memory is smaller than the remaining space of the new memory, in addition to obtaining the process groups in the vehicle system and their corresponding affinity weighted average values, all remaining applications to be cleaned in the vehicle system and their corresponding affinity weighted average values can also be obtained, and the process groups and applications to be cleaned are sorted according to the size of the affinity weighted average values to obtain process groups and applications to be cleaned whose affinity weighted average values are smaller than the preset weighted average values, and application cleaning is performed on the process groups and applications to be cleaned to deeply clean up the applications in the vehicle system and further release the vehicle system space.
[0128] It can be seen that in the above scheme, by first calculating the affinity attribute value of each running application and grouping the running applications according to the affinity attribute value, the dependent process group can be separated from the single application without dependency, and the direct cleaning of the dependent application can be avoided, thereby reducing the delay time of application loading. The dependent process group and the single application without dependency are processed in stages according to the weighted average value of affinity. By giving priority to cleaning applications that occupy a large amount of resources, it can be ensured that important applications and applications currently active by users get more resources, thereby improving the response speed of the system and the smoothness of operation.
[0129] See also Figure 7 , Figure 7 A schematic diagram of the structure of a processing system for cleaning up vehicle system applications provided by the present invention. In one embodiment of the present invention, the processing system for cleaning up vehicle system applications may include but is not limited to a memory acquisition module 10, a memory comparison module 20, an affinity attribute calculation module 30, an initial screening module 40, a target screening module 50, and an application cleaning module 60.
[0130] In one embodiment of the present invention, the memory acquisition module 10 can be used to obtain the initial memory remaining space of the vehicle system. Among them, the car can be powered on first, and the instrument system of the car is started first, the vehicle system is turned on normally, and the running memory allocated to the vehicle system is only 8GB. That is, it can be explained by taking the low-memory running state directly after the vehicle system is turned on as an example. After the vehicle system is turned on, the user can operate the central control screen for a moment in the cockpit and open multiple vehicle applications. At this time, the initial memory remaining space of the vehicle system can be obtained.
[0131] In one embodiment of the present invention, the memory comparison module 20 is used to obtain all running applications in the vehicle system when the initial memory remaining space is less than the preset remaining space. The memory comparison module 200 can also determine whether the initial memory remaining space is less than the preset remaining space. If the initial memory remaining space is less than the preset remaining space, all running applications in the vehicle system are obtained. If the initial memory remaining space is not less than the preset remaining space, a new initial memory remaining space is periodically obtained, and the judgment is repeated until the initial memory remaining space is less than the preset remaining space.
[0132] In one embodiment of the present invention, the affinity attribute calculation module 30 may be used to calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications. Specifically, in the step of calculating the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications, the affinity attribute value X i Satisfies the following formula:
[0133] X i =a*b+c*d,
[0134] Among them, X i represents the affinity attribute value of the i-th running application, a represents the number of other running applications that have a strong dependency relationship with the current running application, b represents the affinity preset value between two running applications with a strong dependency, c represents the number of other running applications that have a weak dependency relationship with the current running application, d represents the affinity preset value between two running applications with a weak dependency, and * represents the product symbol.
[0135] In one embodiment of the present invention, the initial screening module 40 can be used to sort all running applications according to the size of the affinity attribute value, obtain the running applications that are less than the preset affinity value, and represent them as applications to be cleaned. Specifically, all running applications can be sorted from large to small according to the affinity attribute value corresponding to each running application. However, it is not limited to this, and all running applications can also be sorted from small to large according to the affinity attribute value corresponding to each running application. Obtaining running applications that are less than the preset affinity value and representing them as applications to be cleaned means that after all running applications are sorted according to the affinity attribute value, running applications with affinity attribute values less than the preset affinity value can be screened out and represented as applications to be cleaned, that is, the dependency of the application to be cleaned is weak or has no dependency, so that it can be cleaned up first, thereby ensuring the fluency of the vehicle system after cleaning, while avoiding the delay in subsequent application loading due to cleaning of running applications with strong dependencies.
[0136] In one embodiment of the present invention, the target screening module 50 can be used to obtain the insufficient memory score of the application to be cleaned, and sort all the applications to be cleaned according to the size of the insufficient memory score. However, it is not limited to this. The target screening module 50 is also used to obtain the application to be cleaned whose insufficient memory score is greater than the preset score, and represent it as the first determined cleaning application. Specifically, after obtaining the application to be cleaned, the insufficient memory score (OutOfMemory Adjust, OOMADJ) corresponding to the application to be cleaned can be continued to be obtained, and all the applications to be cleaned can be sorted according to the size of the insufficient memory score. Among them, the OOMADJ score is a parameter used to indicate the priority of the application in the Android operating system, which is part of the Low Memory Killer (LMK) strategy. The insufficient memory score determines the priority of the application to be killed when the system is short of memory. The lower the insufficient memory score, the more important the corresponding application is, and the less willing the system is to kill this application under memory pressure. Conversely, the higher the insufficient memory score, the lower the priority of the corresponding application, and when the system needs to release memory, the possibility of this process being killed is greater.
[0137] In one embodiment of the present invention, the application cleaning module 60 can be used to obtain the memory occupancy data of the first determined cleaning application, and perform application cleaning processing on all the first determined cleaning applications in order according to the size of the memory occupancy data. Specifically, after obtaining multiple first determined cleaning applications, the memory occupancy data of the first determined cleaning applications can be continuously obtained, and the multiple first determined cleaning applications can be sorted according to the size of the memory occupancy data, and finally, all the first determined cleaning applications can be sequentially cleaned according to the sorting, so as to realize application cleaning of the vehicle system, and can directly clean the intermediate processes that have a dependency relationship with the main application, thereby improving the fluency of the vehicle system and reducing the application loading delay time.
[0138] In the description of this specification, the description with reference to the terms "this embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0139] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for cleaning up vehicle system applications, characterized in that: include: Get the initial remaining memory space of the vehicle system; When the initial memory remaining space is less than the preset remaining space, obtaining all running applications in the vehicle system; Calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications; Sorting all the running applications according to the affinity attribute values, obtaining the running applications whose affinity values are smaller than a preset affinity value, and indicating them as applications to be cleaned up; Obtaining insufficient memory scores of the applications to be cleaned up, and sorting all the applications to be cleaned up according to the insufficient memory scores; Acquire the to-be-cleaned application whose insufficient memory score is greater than a preset score, and indicate it as a first determined-to-clean application; Acquire memory usage data of the first determined cleanup application, and perform application cleanup processing on all the first determined cleanup applications in sequence according to the size of the memory usage data; Obtaining the remaining memory space of the vehicle system; When the remaining space of the new memory is less than the remaining space of the initial memory, obtaining the applications to be cleaned up and other running applications in the vehicle system; According to the dependency relationship between each running application and other running applications, obtaining at least one process group, wherein the process group includes a plurality of the running applications having a dependency relationship with each other; The affinity attribute values and insufficient memory scores of all running applications in each process group are summed up to generate a total affinity attribute value and a total insufficient memory score; Performing weighted average processing on the total affinity attribute value and the total insufficient memory score of each process group to generate a corresponding weighted average affinity value for each process group; Obtaining the insufficient memory score of the application to be cleaned up, and expressing it as an affinity weighted average of the application to be cleaned up; Sorting the process groups and the to-be-cleaned applications according to the affinity weighted average values, obtaining the to-be-cleaned applications and process groups that are greater than a preset weighted average value, and representing them as a second determined-to-clean application and a second determined-to-clean process group, respectively; Memory occupancy data of the second determined cleanup application and the second determined cleanup process group are obtained, and application cleaning processing is performed on the second determined cleanup application and the second determined cleanup process group in sequence according to the size of the memory occupancy data to generate intermediate memory remaining space of the vehicle system.
2. The method for cleaning up vehicle system applications according to claim 1, characterized in that: Before executing the step of acquiring all running applications in the vehicle system when the initial memory remaining space is less than the preset remaining space, the method further includes: Determine whether the initial memory remaining space is less than the preset remaining space; If the initial memory remaining space is greater than or equal to the preset remaining space, a new initial memory remaining space is periodically acquired, and the determination is repeated until the new initial memory remaining space is less than the preset remaining space.
3. The processing method for cleaning up vehicle system applications according to claim 1, characterized in that: In the step of calculating the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications, the affinity attribute value X i Satisfy the formula: X i =a*b+c*d; Among them, X i represents the affinity attribute value of the i-th running application, a represents the number of other running applications that have a strong dependency relationship with the current running application, b represents the affinity preset value between two running applications with a strong dependency, c represents the number of other running applications that have a weak dependency relationship with the current running application, d represents the affinity preset value between two running applications with a weak dependency, and * represents the product symbol.
4. The method for cleaning up vehicle system applications according to claim 3, characterized in that: When there is a dependency between two running applications, The strong dependency relationship between the two running applications is represented by: when one of the running applications is in a non-running state, the other running application cannot run independently; The weak dependency relationship between the two running applications is represented by: when one of the running applications is not running, the other running application can run independently.
5. The method for cleaning up vehicle system applications according to claim 1, characterized in that: Before executing the step of obtaining the applications to be cleaned up and other running applications in the vehicle system when the remaining space of the new memory is less than the remaining space of the initial memory, the step further includes: Determine whether the new memory remaining space is less than the initial memory remaining space; If the new memory remaining space is greater than or equal to the initial memory remaining space, the new memory remaining space is periodically acquired, and the determination is repeated until the acquired new memory remaining space is less than the initial memory remaining space.
6. The method for cleaning up vehicle system applications according to claim 1, characterized in that: In the step of performing weighted average processing on the total affinity attribute value of the process group and the total insufficient memory score to generate the weighted average affinity value corresponding to each process group, the total affinity attribute value 、Total score of insufficient memory and the affinity weighted average Satisfy the formulas respectively: ; in, It is expressed as the total value of the affinity attribute of the process group. Expressed as the total out-of-memory score for the process group. is expressed as the weighted average of the affinity of the process group, Represents the affinity attribute value of the nth running application in the process group. It is expressed as the memory shortage score of the nth running application in the process group. It is expressed as the weight value of the total value of affinity attribute. Expressed as the weight of the total out-of-memory score, , Represented as the number of running applications in the process group.
7. The method for cleaning up vehicle system applications according to claim 1, characterized in that: After obtaining the memory occupancy data of the second determined cleaning application and the second determined cleaning process group, and sequentially performing application cleaning processing on the second determined cleaning application and the second determined cleaning process group according to the size of the memory occupancy data to generate the intermediate memory remaining space of the vehicle system, the method further includes: When the remaining space of the intermediate memory is less than the remaining space of the new memory, obtaining the process groups in the vehicle system and their corresponding affinity weighted average values; The process groups are sorted according to the size of the affinity weighted average value, and the process groups whose affinity weighted average value is smaller than the preset weighted average value are obtained, and a cleanup process is applied to them.
8. A processing system for cleaning up vehicle system applications, characterized in that: include: A memory acquisition module is used to obtain the initial remaining memory space of the vehicle system; A memory comparison module, used for obtaining all running applications in the vehicle system when the initial memory remaining space is less than the preset remaining space; An affinity attribute calculation module, used to calculate the affinity attribute value of each running application according to the dependency relationship between each running application and other running applications; An initial screening module, used to sort all the running applications according to the affinity attribute values, obtain the running applications whose affinity values are smaller than a preset affinity value, and indicate them as applications to be cleaned up; a target screening module, used for obtaining the insufficient memory scores of the applications to be cleaned up, and sorting all the applications to be cleaned up according to the insufficient memory scores; The target screening module is further used to obtain the to-be-cleaned applications whose insufficient memory scores are greater than a preset score, and represent them as first determined cleaning applications; an application cleaning module, configured to obtain memory usage data of the first determined cleaning applications, and perform application cleaning processing on all the first determined cleaning applications in sequence according to the size of the memory usage data; The application cleaning module is further used to obtain the new remaining memory space of the vehicle system, and when the new remaining memory space is less than the initial remaining memory space, obtain the applications to be cleaned and other running applications in the vehicle system; The application cleaning module is further used to obtain at least one process group according to the dependency relationship between each running application and other running applications, wherein the process group includes multiple running applications having a dependency relationship with each other, respectively sum the affinity attribute values and insufficient memory scores of all running applications in each process group to generate an affinity attribute total value and an insufficient memory total score, and perform weighted average processing on the affinity attribute total value and the insufficient memory total score of each process group to generate a corresponding affinity weighted average value of each process group; The application cleaning module is further used to obtain the insufficient memory score of the application to be cleaned, and express it as the affinity weighted average of the application to be cleaned, sort the process groups and the application to be cleaned according to the size of the affinity weighted average, obtain the application to be cleaned and the process group that are greater than the preset weighted average, and express them as the second determined cleaning application and the second determined cleaning process group respectively; The application cleaning module is also used to obtain the memory usage data of the second determined cleaning application and the second determined cleaning process group, and perform application cleaning processing on the second determined cleaning application and the second determined cleaning process group in turn according to the size of the memory usage data to generate the intermediate memory remaining space of the vehicle system.
