Operating system memory monitoring method, vehicle-mounted system, vehicle and storage medium

By reading the target value configuration file in the operating system and obtaining the actual memory occupancy value comparison, we determine whether the memory occupancy of the on-board applications exceeds the standard and display the over-standard information, the problem of difficulty in monitoring the memory exceeding the standard in the existing technology is solved, and the development and testing efficiency is improved.

CN119597589AInactive Publication Date: 2025-03-11CHENGDU CELIS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411757058.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology lacks monitoring methods for the memory usage of a single operating system, which makes it difficult to timely detect memory exceeding the standard of the on-board applications, which in turn affects the development and testing efficiency.

Method used

An operating system memory monitoring method is provided, which obtains the memory occupancy target value of the on-board application in the operating system by reading a preset target value configuration file, obtains the actual memory occupancy value, and compares the two to determine whether there is a memory exceeding the standard. If the standard exceeds the standard, display the memory exceeding the standard information and take a screenshot.

Benefits of technology

It realizes timely monitoring of the memory exceeding the standard of on-board applications in the operating system, which facilitates timely handling by relevant personnel and improves development and testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597589A_ABST
    Figure CN119597589A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to an operating system memory monitoring method, a vehicle-mounted system, a vehicle and a storage medium, the method comprises the following steps: reading a preset target value configuration file to obtain a memory occupancy target value of a vehicle-mounted application in an operating system; acquiring an actual memory occupancy value of the vehicle-mounted application in the operating system; comparing the actual memory occupancy value with the corresponding memory occupancy target value to determine that the memory occupancy of the vehicle-mounted application exceeds the standard or is normal; if it is determined that the memory occupancy of the vehicle-mounted application exceeds the standard, memory exceeding information is displayed, a display interface is subjected to screen capture, and the memory exceeding information comprises an application package name, an actual memory occupancy value and a memory occupancy target value of the vehicle-mounted application with the memory occupancy exceeding the standard; according to the method, the memory standard exceeding condition of the vehicle-mounted application in the operating system can be well monitored, and related personnel can conveniently process the memory standard exceeding condition in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an operating system memory monitoring method, a vehicle-mounted system, a vehicle and a storage medium. Background Art

[0002] The dual-system architecture of the vehicle system refers to the setting of two operating systems in the vehicle system, such as the QNX system and the Android system. Each operating system is equipped with multiple vehicle applications. For example, the Android system is equipped with vehicle settings, Bluetooth phone, multimedia, driving recorder, 360-degree surround view, air conditioning settings, voice, virtual image and other applications. When the vehicle application is running, it will occupy the memory resources of the operating system. When the memory resource usage of the operating system is abnormal, resulting in low remaining available memory resources, it may cause abnormalities in the entire vehicle system, such as limited use of the application CPU (Central Processing Unit), abnormal termination of the vehicle application, and the car interface being stuck and the screen frozen.

[0003] At present, due to the lack of a monitoring method for the memory usage of a single operating system, it is difficult for relevant personnel to promptly discover the memory excess of in-vehicle applications, and thus difficult to promptly deal with the excess, resulting in relatively low operating system development and testing efficiency. Summary of the invention

[0004] The present invention provides an operating system memory monitoring method, a vehicle-mounted system, a vehicle and a storage medium, so as to solve the problem in the prior art that due to the lack of a monitoring method for the memory occupancy of a single operating system, it is difficult for relevant personnel to promptly discover the memory exceeding the standard of the vehicle-mounted application, and thus it is difficult to promptly handle the exceeding standard.

[0005] The present invention provides an operating system memory monitoring method, the method comprising: reading a preset target value configuration file to obtain a memory occupancy target value of an in-vehicle application in the operating system;

[0006] Obtaining actual memory usage of in-vehicle applications in the operating system;

[0007] By comparing the actual memory usage value with the corresponding memory usage target value, determining whether the memory usage of the vehicle-mounted application exceeds the standard or is normal;

[0008] If it is determined that the memory usage of the vehicle-mounted application exceeds the limit, the memory usage exceeding limit information is displayed and a screenshot of the display interface is taken. The memory usage exceeding limit information includes the application package name of the vehicle-mounted application that exceeds the memory usage limit, the actual memory usage value, and the memory usage target value.

[0009] In one embodiment of the present invention, the step of reading a preset target value configuration file is performed on the premise of determining that the memory monitoring function is turned on; wherein, a pre-registered listener is used to monitor the on / off state of the memory monitoring function.

[0010] In one embodiment of the present invention, the step of obtaining the target value of memory usage of the vehicle-mounted application in the operating system by reading a preset target value configuration file includes:

[0011] Reading the target value configuration file pre-burned to a designated directory of a target disk to obtain structure data;

[0012] The structural data includes: an application package name and a target memory occupancy value, the application package name and the target memory occupancy value correspond one to one, and the application package name is a unique identifier of the vehicle-mounted application.

[0013] In one embodiment of the present invention, the step of obtaining the actual memory usage value of the vehicle-mounted application in the operating system includes:

[0014] Sending a memory information dump command to a service manager preset in the operating system, wherein the memory information dump command is used to instruct the service manager to obtain and feedback memory occupancy information of an application process in the operating system, wherein the memory occupancy information includes an application package name of the application process and a process memory occupancy value;

[0015] According to the application package name in the memory occupancy information, the in-vehicle application to which the process memory occupancy value belongs is determined, and the process memory occupancy value is determined as the actual memory occupancy value of the corresponding in-vehicle application.

[0016] In one embodiment of the present invention, the step of obtaining the actual memory usage value of the vehicle-mounted application in the operating system further includes:

[0017] If there is memory usage information carrying the same application package name, the process memory usage values ​​in the memory usage information carrying the same application package name are summed to obtain the actual memory usage value of the in-vehicle application corresponding to the current application package name.

[0018] In one embodiment of the present invention, it further includes:

[0019] According to a preset event sending frequency, monkey events are regularly sent to the operating system, wherein the monkey events are randomly generated user input events, and the user input events are used to perform random operations on the interface of the vehicle-mounted application.

[0020] In one embodiment of the present invention, it further includes:

[0021] Obtaining the remaining memory capacity of the operating system;

[0022] If the remaining memory capacity is less than the preset capacity threshold and the memory occupancy of all vehicle-mounted applications is normal, the system memory information is displayed and a screenshot of the display interface is taken, the system memory information includes: the remaining memory capacity and the memory information of each vehicle-mounted application, the memory information includes the application package name and the actual memory occupancy value;

[0023] If the remaining memory capacity is less than the capacity threshold and the memory usage of the in-vehicle application exceeds the limit, the remaining content capacity and the memory excess information are displayed, and a screenshot of the display interface is taken.

[0024] The present invention also provides a vehicle-mounted system, comprising:

[0025] Two operating systems, one of which is used to run the operating system memory monitoring method as described in any one of the above items.

[0026] The present invention also provides a vehicle, comprising: the vehicle-mounted system as described above.

[0027] Beneficial effects of the present invention: The present invention provides an operating system memory monitoring method, an in-vehicle system, a vehicle, and a storage medium. The method obtains the target memory usage value of the in-vehicle application in the operating system by reading a preset target value configuration file; obtains the actual memory usage value of the in-vehicle application in the operating system; compares the actual memory usage value with the corresponding target memory usage value to determine whether the memory usage of the in-vehicle application exceeds the standard or is normal; if it is determined that the memory usage of the in-vehicle application exceeds the standard, the memory usage information is displayed, and a screenshot of the display interface is taken. The memory usage information includes the application package name, the actual memory usage value, and the target memory usage value of the in-vehicle application with the memory usage exceeding the standard. The method can better realize the monitoring of the memory usage exceeding the standard of the in-vehicle application in the operating system, which is convenient for relevant personnel to deal with it in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a flow chart of an operating system memory monitoring method provided by an embodiment of the present invention;

[0029] Figure 2 A schematic diagram of a flow chart of presetting a target value configuration file in an operating system memory monitoring method provided in one embodiment of the present invention;

[0030] Figure 3 A flowchart of a specific embodiment of a method for monitoring operating system memory provided by an embodiment of the present invention;

[0031] Figure 4 A schematic diagram of the structure of an operating system memory monitoring device provided by an embodiment of the present invention;

[0032] Figure 5 A schematic diagram of the structure of a vehicle-mounted system provided by an embodiment of the present invention;

[0033] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0035] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0036] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0037] Combine the following Figures 1 to 6 , the operating system memory monitoring method, vehicle-mounted system, vehicle and storage medium provided by the present invention are explained.

[0038] See also Figure 1 , Figure 1 A flowchart of a method for monitoring operating system memory provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0039] S110: Reading a preset target value configuration file to obtain a target value of memory usage of the vehicle-mounted application in the operating system.

[0040] It should be noted that the operating system in this embodiment is the Android system, which belongs to the vehicle-mounted system, and the vehicle-mounted system also includes the QNX system (a real-time operating system based on a microkernel architecture). The QNX system is the main system, which is mainly responsible for functions such as instrument applications, including applications such as instrument HMI (human-machine interface) applications, boot animation applications, and 360 panoramic image applications. The Android system is the secondary system, which is mainly responsible for functions such as central control entertainment information applications, including applications such as vehicle settings, Bluetooth phones, multimedia, driving recorders, air conditioning settings, voice, and virtual images. By pre-setting the target value configuration file and burning the target value configuration file to the target disk of the vehicle-mounted system, it is easy to read the target value of the memory usage of the vehicle-mounted application, thereby facilitating subsequent memory usage comparisons.

[0041] S120: Obtain actual memory usage values ​​of vehicle-mounted applications in the operating system.

[0042] It should be noted that the actual memory usage value of one or more vehicle-mounted applications may be obtained in the above step S120, that is, the actual memory usage value of a specified vehicle-mounted application may be obtained, and the specified vehicle-mounted application may be one or more, or the actual memory usage value of all vehicle-mounted applications in the operating system may be obtained. In order to better monitor the memory usage of each vehicle-mounted application in the operating system, in this embodiment, the actual memory usage value of all vehicle-mounted applications in the operating system is obtained, and subsequent comparison and monitoring are performed.

[0043] S130: Determine whether the memory usage of the vehicle-mounted application exceeds the limit or is normal by comparing the actual memory usage value with the corresponding memory usage target value.

[0044] S140: If it is determined that the memory usage of the vehicle-mounted application exceeds the limit, the memory usage exceeding limit information is displayed and a screenshot of the display interface is taken. The memory usage exceeding limit information includes the application package name of the vehicle-mounted application that exceeds the memory usage limit, the actual memory usage value, and the memory usage target value.

[0045] It should be noted that, through the above steps, the real-time monitoring of the memory usage of each vehicle-mounted application in the operating system can be well achieved, so that relevant personnel can handle the memory excess situation in a timely manner, such as reporting bugs (defects), etc. The display method of the memory excess information can be a green screen with red text, etc., which is convenient for relevant personnel to identify.

[0046] In some embodiments, the step of reading a preset target value configuration file is performed on the premise of determining that a memory monitoring function is turned on; wherein a pre-registered listener is used to monitor the on / off status of the memory monitoring function.

[0047] In some embodiments, the step of obtaining the on / off state of the memory monitoring function includes:

[0048] 1. When it is determined that the operating system has been started, a pre-registered listener is used to monitor the attribute value of the memory monitoring switch, the memory monitoring switch is a preset system attribute, and the attribute value of the memory monitoring switch changes with the on / off state of the memory monitoring switch, and the on / off state of the memory monitoring switch is set by the user.

[0049] It should be noted that the operating system in this embodiment is the Android system. After the Android system is started, the AMS (Activity Manager Service) service of the Android system is started, and the operating system memory monitoring device built into the AMS service (the device for running the operating system memory monitoring method) is started. In order to determine whether memory monitoring is required, the operating system memory monitoring device needs to obtain the on / off status of the memory monitoring function, so that when it is determined that the memory monitoring function is turned on, subsequent file reading and obtaining the actual memory usage value of the vehicle-mounted application and other operations are performed. This step improves the controllability of the entire dual-system memory monitoring method.

[0050] Specifically, a user (tester or developer, etc.) can turn on or off the memory monitoring switch in the engineering mode application of the operating system (Android system). When the user turns on the memory monitoring switch, the engineering mode application sets the attribute value of the memory monitoring switch to a preset first attribute value. Conversely, when the user turns off the memory monitoring switch, the engineering mode application sets the attribute value of the memory monitoring switch to a preset second attribute value. The first attribute value is different from the second attribute value.

[0051] 2. If it is detected that the attribute value of the memory monitoring switch is a preset first attribute value, it is determined that the memory monitoring function has been turned on.

[0052] 3. If it is detected that the attribute value of the memory monitoring switch is a preset second attribute value, it is determined that the memory monitoring function is turned off.

[0053] It should be noted that the first attribute value may be True, etc., and the second attribute value may be False, etc.

[0054] In addition to using a listener to monitor the attribute value of the memory monitoring switch when determining that the operating system is started, in some embodiments, the following is also included:

[0055] 1. Using the monitor, monitor the change of the attribute value of the memory monitoring switch.

[0056] 2. If it is monitored that the attribute value of the memory monitoring switch changes from the first attribute value to the second attribute value, the memory monitoring function is turned off.

[0057] 3. If it is monitored that the attribute value of the memory monitoring switch changes from the second attribute value to the first attribute value, the memory monitoring function is turned on.

[0058] It should be noted that by using a listener to monitor changes in the attribute value of the memory monitoring switch, the memory monitoring function can be turned on and off at any time.

[0059] In some embodiments, the step of obtaining the target value of memory usage of the vehicle-mounted application in the operating system by reading a preset target value configuration file includes:

[0060] The target value configuration file pre-burned to the designated directory of the target disk is read to obtain the structure data.

[0061] The structural data includes: an application package name and a target memory occupancy value, the application package name and the target memory occupancy value correspond one to one, and the application package name is a unique identifier of the vehicle-mounted application.

[0062] It should be noted that by parsing the target value configuration file into the above structured data, it is possible to directly obtain the memory usage target value of the corresponding application package name and perform targeted comparison in the subsequent comparison process.

[0063] It should also be noted that the target value configuration file is pre-configured with information such as the application package name, the memory usage target value, and the system to which the application belongs. The memory usage target value corresponding to each application package name in the target value configuration file is a preset empirical value, such as the memory usage target value of the Android system navigation application (application package name com.android.navi) is 500MB (megabytes), and the memory target value of the Android system vehicle setting application (application package name com.android.carsettig) is set to 300MB.

[0064] It should be mentioned that by setting the corresponding memory usage target value for the vehicle-mounted application in the target value configuration file, the upper limit of the memory usage of each vehicle-mounted application can be clearly defined, thereby facilitating subsequent memory monitoring.

[0065] Figure 2 This is a flow chart of presetting a target value configuration file (pre-burning the target value configuration file to a specified directory of the target disk) in the operating system memory monitoring method provided in one embodiment of the present invention. Please refer to Figure 2First, write the target value configuration file in the system (Android system) source code. Secondly, use the preset compilation tools, such as Jenkins (an open source automation server), etc. to compile and package the system source code. The compiled product is the system flashing package. Burn the system flashing package to the specified directory of the target disk of the vehicle system to complete the preset target value configuration file. By burning the target value configuration file to the specified directory of the above-mentioned target disk, it is possible to facilitate subsequent file reading and improve file reading efficiency. It should be mentioned that the system source code also includes product.mk (product build configuration file) and the like.

[0066] In some embodiments, the step of obtaining the actual memory usage value of the vehicle-mounted application in the operating system includes: regularly obtaining the actual memory usage value of the vehicle-mounted application in the operating system according to a target monitoring frequency, wherein the step of determining the target monitoring frequency includes:

[0067] 1. Obtain the CPU usage of the system recycling thread (kswapd) preset in the operating system and the remaining memory capacity of the operating system.

[0068] 2. If the CPU usage is less than a preset usage threshold, and the remaining memory capacity is greater than a preset memory capacity threshold, the target monitoring frequency is determined to be a first preset frequency.

[0069] 3. If the CPU usage is greater than the usage threshold, and the remaining memory capacity is greater than the memory capacity threshold, the target monitoring frequency is determined to be a second preset frequency.

[0070] 4. If the CPU usage is less than the usage threshold, and the remaining memory capacity is less than the memory capacity threshold, the target monitoring frequency is determined to be a third preset frequency.

[0071] 5. If the CPU usage is greater than the usage threshold and the remaining memory capacity is less than the memory capacity threshold, the target monitoring frequency is determined to be a fourth preset frequency, the first preset frequency, the second preset frequency, and the third preset frequency increase sequentially, and the fourth preset frequency is greater than or equal to the third preset frequency.

[0072] It should be noted that if the CPU usage of the system recovery thread is greater than the usage threshold, and / or the remaining memory capacity of the operating system (Android system) is less than the memory capacity threshold, it means that the operating system is short of memory at this time. Therefore, in the above embodiment, different target monitoring frequencies are set according to the different values ​​of these two information to ensure timely and effective monitoring of the operating system's memory exceeding the standard when the operating system is short of memory, so as to facilitate subsequent data analysis by relevant personnel.

[0073] It should also be noted that the usage rate threshold and the memory capacity threshold can be set according to actual conditions, such as the usage rate threshold is 20%, 21%, and the memory capacity threshold is 320MB, 330MB, etc. The first preset frequency can be 30 seconds / time, etc., the second preset frequency can be 10 seconds / time, the third preset frequency can be 5 seconds / time, etc., and the fourth preset frequency can be 5 seconds / time, etc. It is only necessary to ensure that the first preset frequency, the second preset frequency, and the third preset frequency increase in sequence, and the fourth preset frequency is greater than or equal to the third preset frequency.

[0074] In some embodiments, the step of obtaining the actual memory usage value of the in-vehicle application in the operating system includes:

[0075] 1. Send a memory information dump command (dumpsysmeminfo command) to the service manager preset in the operating system, wherein the memory information dump command is used to instruct the service manager to obtain the memory usage information of the application process in the operating system and feedback it, wherein the memory usage information includes the application package name of the application process and the process memory usage value.

[0076] It should be noted that the memory usage information corresponds one-to-one to the application process in the operating system.

[0077] 2. Determine the in-vehicle application to which the process memory occupancy value belongs according to the application package name in the memory occupancy information, and determine the process memory occupancy value as the actual memory occupancy value of the corresponding in-vehicle application.

[0078] It should be noted that, since the applications in the vehicle system are basically single-process applications, the memory monitoring requirements of the vehicle system can be better met by executing the above steps.

[0079] Specifically, if the application package names of all the memory usage information are different, it means that the vehicle-mounted applications of the operating system are all single-process applications, so the process memory usage value in the memory usage information is directly determined as the actual memory usage value of the corresponding vehicle-mounted application.

[0080] In some embodiments, the step of obtaining the actual memory usage value of the in-vehicle application in the operating system further includes:

[0081] If there is memory usage information carrying the same application package name, the process memory usage values ​​in the memory usage information carrying the same application package name are summed to obtain the actual memory usage value of the in-vehicle application corresponding to the current application package name.

[0082] It can be understood that, by traversing the application package names, if the same application package name exists, the process memory occupancy values ​​with the same application package name are summed to obtain the actual memory occupancy value of the vehicle-mounted application corresponding to the current application package name; the remaining process memory occupancy values ​​are determined as the target memory occupancy values, and according to the application package name corresponding to the target memory occupancy value, the vehicle-mounted application to which the target memory occupancy value belongs is determined, and the target memory occupancy value is determined as the actual memory occupancy value of the corresponding vehicle-mounted application.

[0083] In the above embodiment, if the application package name in the memory occupancy information is the same, it means that the application corresponding to the application package name is a multi-process application. Therefore, the process memory occupancy values ​​with the same application package name are summed to obtain the actual memory occupancy value of the vehicle-mounted application corresponding to the current application package name. The vehicle-mounted application corresponding to the remaining memory occupancy information is a single-process application. Therefore, the process memory occupancy value in the remaining memory occupancy information is the actual memory occupancy value of the corresponding vehicle-mounted application. It can be understood that if there are multi-process applications in the vehicle-mounted system, by executing the above steps, the actual memory occupancy value of the multi-process application can also be obtained, thereby realizing memory occupancy monitoring.

[0084] In some embodiments, the step of comparing the actual memory usage value with the corresponding memory usage target value to determine whether the memory usage of the vehicle application exceeds the standard or is normal includes:

[0085] 1. If the actual memory usage value exceeds the corresponding memory usage target value, it is determined that the memory usage of the current in-vehicle application exceeds the target value.

[0086] 2. If the actual memory usage value is less than or equal to the memory usage target value, it is determined that the current memory usage of the in-vehicle application is normal.

[0087] It should be noted that, through the above steps, it is possible to better monitor the memory exceeding the limit of vehicle-mounted applications.

[0088] In some embodiments, it also includes:

[0089] According to a preset event sending frequency, Monkey events are regularly sent to the operating system, wherein the Monkey events are randomly generated user input events, and the user input events are used to perform random operations on the interface of the vehicle-mounted application.

[0090] It should be noted that the event sending frequency can be set according to actual conditions, such as 500 milliseconds / time. User input events include random clicks, slides, scrolls, long presses, and text input. By regularly sending Monkey events to the operating system, it is possible to simulate real events, thereby fully covering the operating logic of each vehicle-mounted application, fully exposing the memory usage of each vehicle-mounted application, and facilitating early monitoring of the memory usage problem of the vehicle-mounted application, so as to deal with it as soon as possible.

[0091] In some embodiments, it also includes:

[0092] 1. Obtain the remaining memory capacity of the operating system.

[0093] 2. If the remaining memory capacity is less than the preset capacity threshold and the memory usage of all vehicle-mounted applications is normal, the system memory information is displayed and a screenshot of the display interface is taken. The system memory information includes: the remaining memory capacity and the memory information of each vehicle-mounted application. The memory information includes the application package name and the actual memory usage value.

[0094] It should be noted that the capacity threshold can be set according to actual conditions, such as 320MB (megabytes), etc. Through the above steps, real-time monitoring of the remaining memory status of the operating system can be achieved.

[0095] 3. If the remaining memory capacity is less than the capacity threshold and the memory usage of the in-vehicle application exceeds the limit, the remaining content capacity and the memory excess information are displayed, and a screenshot of the display interface is taken.

[0096] It should be noted that in order to avoid the relevant personnel from failing to obtain the corresponding information in a timely manner due to the rapid changes in the memory over-standard information displayed in the over-standard display interface, when it is determined that the over-standard display interface pops up on the display screen, or the display data in the over-standard display interface changes, a screenshot of the over-standard display interface is taken and the screenshot image is saved to the target directory of the target disk, which can facilitate subsequent relevant personnel to identify and handle the over-standard situation.

[0097] It should be mentioned that the naming format of the screenshot image can be set according to actual conditions, such as the current time.

[0098] The following is a specific example to explain the operating system memory monitoring method in the above embodiment. Figure 3 , S310: Start the Android system and QNX system.

[0099] S320: Determine whether the memory monitoring function of the Android system is turned on.

[0100] S330: When it is determined that the memory monitoring function is turned on, a preset target value configuration file is read to obtain a target value of memory usage of the vehicle-mounted application in the operating system; and an actual memory usage value of the vehicle-mounted application in the operating system is obtained.

[0101] S340: Compare the actual memory usage value with the corresponding memory usage target value to determine whether the memory usage of the vehicle-mounted application exceeds the limit or is normal, display the memory excess information, and take a screenshot of the display interface.

[0102] The operating system memory monitoring device provided by the present invention is described below. The operating system memory monitoring device described below and the operating system memory monitoring method described above can be referenced to each other.

[0103] Please refer to Figure 4 , the operating system memory monitoring device provided in this embodiment includes:

[0104] The target value reading module 410 is used to read a preset target value configuration file to obtain a target value of memory usage of the vehicle-mounted application in the operating system;

[0105] A memory occupancy acquisition module 420 is used to acquire the actual memory occupancy value of the vehicle-mounted application in the operating system;

[0106] A first processing module 430 is used to compare the actual memory usage value with the corresponding memory usage target value to determine whether the memory usage of the vehicle-mounted application exceeds the standard or is normal;

[0107] The second processing module 440 is used to display the memory exceeding standard information and take a screenshot of the display interface if it is determined that the memory usage of the vehicle-mounted application exceeds the standard. The memory exceeding standard information includes the application package name of the vehicle-mounted application with excessive memory usage, the actual memory usage value, and the memory usage target value. The target value reading module 410, the memory usage acquisition module 420, the first processing module 430, and the second processing module 440 are connected.

[0108] In some embodiments, it also includes: a status acquisition module, which is used to monitor the on and off status of the memory monitoring function using a pre-registered listener.

[0109] In some embodiments, the target value reading module 410 is specifically used to read the target value configuration file pre-burned to a designated directory of a target disk to obtain the structure data;

[0110] The structural data includes: an application package name and a target memory occupancy value, the application package name and the target memory occupancy value correspond one to one, and the application package name is a unique identifier of the vehicle-mounted application.

[0111] In some embodiments, the memory occupancy acquisition module 420 is specifically used to send a memory information dump command to a service manager preset in the operating system, and the memory information dump command is used to instruct the service manager to obtain the memory occupancy information of the application process in the operating system and feedback it, and the memory occupancy information includes the application package name of the application process and the process memory occupancy value;

[0112] According to the application package name in the memory occupancy information, the in-vehicle application to which the process memory occupancy value belongs is determined, and the process memory occupancy value is determined as the actual memory occupancy value of the corresponding in-vehicle application.

[0113] In some embodiments, the memory occupancy acquisition module 420 is also specifically used to sum the process memory occupancy values ​​in the memory occupancy information carrying the same application package name if there is memory occupancy information carrying the same application package name, so as to obtain the actual memory occupancy value of the vehicle-mounted application corresponding to the current application package name.

[0114] In some embodiments, it also includes: a monkey event sending module, which is used to periodically send monkey events to the operating system according to a preset event sending frequency, and the monkey event is a randomly generated user input event, and the user input event is used to perform random operations on the interface of the vehicle-mounted application.

[0115] In some embodiments, the system further includes: a third processing module, configured to obtain the remaining memory capacity of the operating system;

[0116] If the remaining memory capacity is less than the preset capacity threshold and the memory occupancy of all vehicle-mounted applications is normal, the system memory information is displayed and a screenshot of the display interface is taken, the system memory information includes: the remaining memory capacity and the memory information of each vehicle-mounted application, the memory information includes the application package name and the actual memory occupancy value;

[0117] If the remaining memory capacity is less than the capacity threshold and the memory usage of the in-vehicle application exceeds the limit, the remaining content capacity and the memory excess information are displayed, and a screenshot of the display interface is taken.

[0118] Please refer to Figure 5 This embodiment also provides a vehicle-mounted system, including:

[0119] Two operating systems, one of which includes the operating system memory monitoring device as described above. The operating system memory monitoring device is used to run the operating system memory monitoring method as described in any of the above items. It should be noted that in this embodiment, the two operating systems are QNX system and Android system, respectively, wherein the Android system includes the operating system memory monitoring device. In addition, the vehicle-mounted system also includes a Hypervisor (virtual machine monitor) and a SOC (System on Chip, system-on-chip) chip, etc. The Hypervisor includes a CPU virtualization module, a memory virtualization module, and a virtual machine communication module, etc. The Android system is connected to the memory virtualization module to obtain its corresponding memory resources. The vehicle-mounted system in this embodiment can achieve the beneficial effects achieved by any of the above items.

[0120] This embodiment further provides a vehicle, comprising: the vehicle-mounted system as described above. The vehicle in this embodiment can achieve the beneficial effects achieved by any of the above items.

[0121] In some embodiments, an electronic device is also provided, which may be a server, and its internal structure is shown in FIG. Figure 6 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the functions or steps on the server side of the above method are implemented.

[0122] In some embodiments, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining a memory usage target value of an in-vehicle application in an operating system by reading a preset target value configuration file; obtaining an actual memory usage value of an in-vehicle application in the operating system; determining whether the memory usage of the in-vehicle application exceeds the standard or is normal by comparing the actual memory usage value with the corresponding memory usage target value; if it is determined that the memory usage of the in-vehicle application exceeds the standard, displaying the memory usage excess information and taking a screenshot of the display interface, wherein the memory usage excess information includes the application package name, the actual memory usage value, and the memory usage target value of the in-vehicle application whose memory usage exceeds the standard.

[0123] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a memory usage target value of an in-vehicle application in an operating system by reading a preset target value configuration file; obtaining an actual memory usage value of an in-vehicle application in the operating system; determining whether the memory usage of the in-vehicle application exceeds the standard or is normal by comparing the actual memory usage value with the corresponding memory usage target value; if it is determined that the memory usage of the in-vehicle application exceeds the standard, displaying the memory usage exceeding standard information and taking a screenshot of the display interface, the memory usage exceeding standard information including the application package name of the in-vehicle application whose memory usage exceeds the standard, the actual memory usage value, and the memory usage target value.

[0124] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or electronic device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for monitoring operating system memory, characterized in that: include: Reading a preset target value configuration file to obtain a target value of memory usage of the vehicle-mounted application in the operating system; Obtaining actual memory usage of in-vehicle applications in the operating system; By comparing the actual memory usage value with the corresponding memory usage target value, determining whether the memory usage of the vehicle-mounted application exceeds the standard or is normal; If it is determined that the memory usage of the vehicle-mounted application exceeds the limit, the memory usage exceeding limit information is displayed and a screenshot of the display interface is taken. The memory usage exceeding limit information includes the application package name of the vehicle-mounted application that exceeds the memory usage limit, the actual memory usage value, and the memory usage target value.

2. The operating system memory monitoring method according to claim 1, characterized in that: The step of reading the preset target value configuration file is performed on the premise of determining that the memory monitoring function is turned on; wherein, the on / off state of the memory monitoring function is monitored using a pre-registered listener.

3. The operating system memory monitoring method according to claim 1 or 2, characterized in that: The steps of obtaining the target value of memory usage of the vehicle-mounted application in the operating system by reading the preset target value configuration file include: Reading the target value configuration file pre-burned to a designated directory of a target disk to obtain structure data; The structural data includes: an application package name and a target memory occupancy value, the application package name and the target memory occupancy value correspond one to one, and the application package name is a unique identifier of the vehicle-mounted application.

4. The operating system memory monitoring method according to claim 1, characterized in that: The step of obtaining the actual memory usage value of the vehicle-mounted application in the operating system includes: Sending a memory information dump command to a service manager preset in the operating system, wherein the memory information dump command is used to instruct the service manager to obtain and feedback memory occupancy information of an application process in the operating system, wherein the memory occupancy information includes an application package name of the application process and a process memory occupancy value; According to the application package name in the memory occupancy information, the in-vehicle application to which the process memory occupancy value belongs is determined, and the process memory occupancy value is determined as the actual memory occupancy value of the corresponding in-vehicle application.

5. The operating system memory monitoring method according to claim 4, characterized in that: The step of obtaining the actual memory usage value of the vehicle-mounted application in the operating system also includes: If there is memory usage information carrying the same application package name, the process memory usage values ​​in the memory usage information carrying the same application package name are summed to obtain the actual memory usage value of the in-vehicle application corresponding to the current application package name.

6. The operating system memory monitoring method according to claim 1, characterized in that: Also includes: According to a preset event sending frequency, monkey events are regularly sent to the operating system, wherein the monkey events are randomly generated user input events, and the user input events are used to perform random operations on the interface of the vehicle-mounted application.

7. The operating system memory monitoring method according to claim 1, characterized in that: Also includes: Obtaining the remaining memory capacity of the operating system; If the remaining memory capacity is less than the preset capacity threshold and the memory occupancy of all vehicle-mounted applications is normal, the system memory information is displayed and a screenshot of the display interface is taken, the system memory information includes: the remaining memory capacity and the memory information of each vehicle-mounted application, the memory information includes the application package name and the actual memory occupancy value; If the remaining memory capacity is less than the capacity threshold and the memory usage of the in-vehicle application exceeds the limit, the remaining content capacity and the memory excess information are displayed, and a screenshot of the display interface is taken.

8. A vehicle-mounted system, characterized in that: include: Two operating systems, one of which is used to run the operating system memory monitoring method as described in any one of claims 1 to 7.

9. A vehicle, characterized in that: include: The vehicle-mounted system as claimed in claim 8.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the operating system memory monitoring method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Equipment abnormal information display method and computer equipment

    CN108920337A

  • Monitoring method and monitoring device for computer system and application program

    CN111752800A

  • Memory monitoring method and device, electronic equipment and storage medium

    CN118152229A

  • Method, an electronic device, and a storage medium for auto-cleaning up applications in a background

    US20150058867A1