Dual system memory monitoring method, vehicle-mounted system, vehicle, equipment and storage medium
By monitoring the memory occupancy information of each application in dual systems, the problem of difficulty in time discovering memory occupancy abnormalities in the existing technology is solved, real-time monitoring and processing of memory exceeding the standard of the vehicle system is realized, and the fluency and security of the system are improved.
Patent Information
- Application Number
- CN202411757090.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Due to the lack of monitoring methods for the memory usage of dual systems and applications in dual systems, it is difficult to detect memory usage abnormalities in time, which in turn affects the smoothness and security of the on-board system.
A dual-system memory monitoring method is provided, by obtaining memory occupancy information of the application process in the first operating system and sending information acquisition instructions to the second operating system, and obtaining memory occupancy information of the application process in the second operating system. Based on this information and the pre-configured memory occupancy target value, the memory exceeding the standard of each application in the dual system is monitored.
Real-time monitoring of memory exceeding standards for each application in the dual system is realized, helping relevant personnel to timely discover and deal with memory exceeding standards, and improving the fluency and security of the on-board system.
Smart Images

Figure CN119226096B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a dual-system memory monitoring method, an on-board system, a vehicle, a device and a storage medium. Background Art
[0002] With the continuous development of smart cars and autonomous driving technology, the complexity of vehicle systems continues to increase, and dual systems are gradually becoming a trend. More and more vehicle systems are beginning to adopt dual system architectures to separate safety-critical applications from non-safety applications to improve system safety and reliability. For example: one operating system is used for vehicle control and safety monitoring, and the other operating system is used for entertainment and information services.
[0003] In a dual-system architecture, the two operating systems usually have their own memory resources, and the memory usage of each operating system will affect the fluency of the entire vehicle system. When the available memory of any operating system is low, various operating anomalies may occur, such as a black screen on the instrument panel interface, operating system restart, etc. At present, due to the lack of a monitoring method for the memory usage of the dual system and each application in the dual system, it is difficult to detect abnormal memory usage in a timely manner, and it is difficult to handle the abnormal situation in a timely manner, resulting in impaired fluency of the vehicle system and reduced safety. Summary of the invention
[0004] The present invention provides a dual-system memory monitoring method, an in-vehicle system, a vehicle, a device and a storage medium to solve the problem in the prior art that it is difficult to timely detect memory occupancy anomalies due to the lack of a monitoring method for the memory occupancy of the dual systems and each application in the dual systems.
[0005] The dual-system memory monitoring method provided by the present invention is applied to a first operating system, and the method comprises: obtaining first memory occupancy information of an application process, and sending an information acquisition instruction to a second operating system, wherein the information acquisition instruction is used to instruct the second operating system to obtain second memory occupancy information and feedback the information, wherein the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system;
[0006] Based on the first memory usage information, the second memory usage information, and the pre-configured memory usage target values of each application, the memory exceeding condition of the application in the first operating system and the second operating system is monitored, the application corresponds to at least one application process, and the memory usage value of the application is obtained based on the memory usage information of the application process of the application.
[0007] In one embodiment of the present invention, the prerequisite for obtaining the first memory usage information of the application process and sending an information acquisition instruction to the second operating system is to determine that the memory monitoring function is turned on; wherein, a pre-registered listener is used to monitor the on and off status of the memory monitoring function.
[0008] In one embodiment of the present invention, the step of sending the information acquisition instruction to the second operating system includes:
[0009] The information acquisition instruction is sent to a communication server preset in the second operating system through a preset communication client, and the information acquisition instruction is transmitted to a system memory monitoring module preset in the second operating system via the communication server;
[0010] The information acquisition instruction is used to instruct the system memory monitoring module to obtain the second memory occupancy information using a preset memory acquisition tool, and feed back the second memory occupancy information to the communication client through the communication server.
[0011] In one embodiment of the present invention, the step of obtaining the target memory usage value of each application includes:
[0012] Reading a preset target value configuration file to obtain target data, wherein the target value configuration file is a file pre-burned to a designated directory of a target disk;
[0013] The target data includes: an application package name, a memory usage target value, and a system to which the application belongs. The application package name is a unique identifier of the application. The first memory usage information and the second memory usage information both carry the corresponding application package name. The application package name corresponds one-to-one to the memory usage target value. The system to which the application belongs is the first operating system or the second operating system.
[0014] In one embodiment of the present invention, the first memory occupancy information and the second memory occupancy information are periodically acquired according to a target monitoring frequency;
[0015] Wherein, the step of determining the target monitoring frequency includes:
[0016] Obtaining a CPU usage rate of a preset system recycling thread and a remaining memory capacity of the first operating system;
[0017] Different target monitoring frequencies are obtained according to the comparison result of the CPU usage rate with a preset usage rate threshold value, and the comparison result of the remaining memory capacity with a preset memory capacity threshold value.
[0018] In one embodiment of the present invention, the step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system includes:
[0019] The memory occupancy value in the first memory occupancy information and the memory occupancy value in the second memory occupancy information are respectively compared with the corresponding memory occupancy target values to obtain the memory exceeding status of each application in the first operating system and the second operating system.
[0020] In one embodiment of the present invention, the step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes:
[0021] If there is first memory usage information or second memory usage information carrying the same application package name, the memory usage values in the first memory usage information or second memory usage information carrying the same application package name are summed and then compared with the corresponding memory usage target value.
[0022] In one embodiment of the present invention, the step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes:
[0023] If any application has excessive memory, obtain the memory excess information of the current application;
[0024] An excess display interface pops up on a preset display screen to display the memory excess information, wherein the information is displayed in order of the size of the memory usage value of the application and / or the size of the excess value of the application.
[0025] In one embodiment of the present invention, when it is determined that the display screen pops up an excess display interface, or the display data in the excess display interface changes, a screenshot of the excess display interface is taken, and the screenshot image is saved to a target directory of the target disk.
[0026] The present invention also provides a vehicle-mounted system, comprising: a first operating system and a second operating system, wherein the first operating system is used to run the dual-system memory monitoring method as described in any one of the above items.
[0027] The present invention also provides a vehicle, comprising: the vehicle-mounted system as described above.
[0028] The present invention also provides an electronic device, comprising a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement a dual-system memory monitoring method provided in any of the above embodiments.
[0029] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer program is used to enable a computer to execute the dual-system memory monitoring method provided in any of the above embodiments.
[0030] Beneficial effects of the present invention: The dual-system memory monitoring method, vehicle-mounted system, vehicle, equipment and storage medium provided by the present invention are applied to a first operating system, by obtaining first memory occupancy information of an application process in the first operating system, and sending an information acquisition instruction to a second operating system, the information acquisition instruction is used to instruct the second operating system to obtain second memory occupancy information and feedback, the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system; according to the first memory occupancy information, the second memory occupancy information, and the pre-configured memory occupancy target values of each application, the memory excess situation of each application in the first operating system and the second operating system is monitored, the application corresponds to at least one application process, and the memory occupancy value of the application is obtained according to the memory occupancy information of the application process of the application; the method can monitor the memory excess situation of each application in the dual system in real time, which is helpful for relevant personnel to promptly discover the memory excess situation, thereby promptly handling the memory excess situation, and the cost is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a dual-system memory monitoring method according to an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of a flow chart of presetting a target value configuration file in a dual-system memory monitoring method provided in an embodiment of the present invention;
[0033] Figure 3 A flowchart of a specific embodiment of a dual-system memory monitoring method provided in one embodiment of the present invention;
[0034] Figure 4 A schematic diagram of the structure of a dual-system memory monitoring device provided by an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of the structure of a vehicle-mounted system provided by an embodiment of the present invention;
[0036] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] 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.
[0038] 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.
[0039] 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.
[0040] Combine the following Figures 1 to 6 , the dual-system memory monitoring method, vehicle-mounted system, vehicle, equipment and storage medium provided by the present invention are explained.
[0041] See also Figure 1 , Figure 1 A schematic diagram of a dual system memory monitoring method according to an embodiment of the present invention is provided. The method is applied to a first operating system, such as Figure 1 As shown, the method includes:
[0042] S110: Obtain first memory occupancy information of the application process, and send an information acquisition instruction to the second operating system, wherein the information acquisition instruction is used to instruct the second operating system to obtain second memory occupancy information and feedback it, wherein the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system.
[0043] It should be noted that obtaining the first memory occupancy information of the application process refers to obtaining the first memory occupancy information of the application process in the first operating system. The above-mentioned steps of obtaining the first memory occupancy information and sending the information acquisition instruction to the second operating system can be performed successively or simultaneously. The step of obtaining the first memory occupancy information of the application process in the first operating system includes: sending a memory information dump command (dumpsysmeminfo command) to the service manager in the first operating system, and the memory information dump command is used to instruct the service manager to obtain the first memory occupancy information of the application process in the first operating system and feedback.
[0044] It should also be noted that one of the first memory occupancy information corresponds to an application process in the first operating system, and similarly, one of the second memory occupancy information corresponds to an application process in the second operating system. The first memory occupancy information obtained in the above step S110 may be one or more, that is, the first memory occupancy information of all application processes in the first operating system may be obtained, or the first memory occupancy information of the application process of a specified application may be obtained, and the specified application may be one or more, and each application corresponds to one or more application processes. In order to achieve comprehensive monitoring of the memory occupancy of the first operating system, the first memory occupancy information of all application processes in the first operating system is obtained in this embodiment. In the specific implementation process, it can also be adjusted according to actual needs. Similarly, the second memory occupancy information obtained in the above step S110 may also be one or more, which will not be repeated here. In order to achieve comprehensive monitoring of the memory occupancy of the second operating system, the second memory occupancy information of all application processes in the second operating system is obtained in this embodiment.
[0045] It should be mentioned that the first operating system and the second operating system form a dual system. In this embodiment, the first operating system is the Android system, and the second operating system is 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 a 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. In the specific implementation process, the first operating system and the second operating system can also be other operating systems, such as the first operating system is an operating system with the same or similar capabilities as the Android system, and the second operating system is a Linux system (an open source operating system).
[0046] It should also be mentioned that the available memory corresponding to the Android system is usually larger than the available memory corresponding to the QNX system, for example: the available memory corresponding to the Android system is 7.7GB (gigabytes), and the available memory corresponding to the QNX system is 4.3 GB, etc. Therefore, the dual-system memory monitoring method provided by the present invention runs on the Android system to ensure the stability of the dual-system memory monitoring.
[0047] S120: Based on the first memory usage information, the second memory usage information, and the pre-configured memory usage target values of each application, monitor the memory exceeding condition of the applications in the first operating system and the second operating system, the application corresponds to at least one application process, and the memory usage value of the application is obtained based on the memory usage information of the application process of the application.
[0048] It should be noted that the memory overload refers to the memory usage value of the application exceeding the corresponding memory usage target value. According to the first memory usage information, the second memory usage information, and the pre-configured memory usage target values of each application, the memory overload situation of each application in the first operating system and the second operating system can be obtained, thereby realizing real-time monitoring of the overload situation of each application. The first memory usage information and the second memory usage information both carry the corresponding application package name, which is a unique identifier used to distinguish different applications. According to the application package name carried by the first memory usage information and the second memory usage information, it can be distinguished which application process the information belongs to. Each application corresponds to one or more application processes. Moreover, the first memory usage information and the second memory usage information both include the memory usage value of the corresponding application process. In the specific implementation process, if there are multi-process applications in the first operating system and the second operating system, the memory usage value of the multi-process application is the sum of the memory usage values of all corresponding application processes. For a single-process application, there is only one corresponding application process, so the memory usage value of the single-process application is the memory usage value of the corresponding application process. It should be mentioned that the applications in the vehicle-mounted system or the vehicle computer system are basically single-process applications.
[0049] It should also be noted that through the above steps, the memory usage or memory excess situation of each application in the first operating system and the second operating system can be better monitored, which is convenient for relevant personnel to promptly discover the memory excess problem and then solve the problem in time.
[0050] In some embodiments, the prerequisite for obtaining the first memory usage information of the application process and sending the information acquisition instruction to the second operating system is to determine that the memory monitoring function is turned on; wherein, a pre-registered listener is used to monitor the on and off status of the memory monitoring function.
[0051] In some embodiments, the step of monitoring the on / off state of the memory monitoring function using a pre-registered listener includes:
[0052] 1. When it is determined that the first operating system and the second operating system have been started, the listener is used to perform targeted monitoring on 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.
[0053] It should be noted that if the first operating system is an Android system and the second operating system is a QNX system, then after the Android system and the QNX system are started, the system memory monitoring module preset in the QNX system is started, the AMS (Activity Manager Service) service of the Android system is started, and the dual-system memory monitoring device (the device for running the dual-system memory monitoring method) built into the AMS service is started. In order to determine whether memory monitoring is required, the dual-system memory monitoring device needs to obtain the on and off status of the memory monitoring function, so that when it is determined that the memory monitoring function is turned on, the first memory occupancy information of the application process in the first operating system is obtained, and an information acquisition instruction is sent to the second operating system. This step improves the controllability of the entire dual-system memory monitoring method.
[0054] Specifically, a user (a tester or developer, etc.) can turn on or off the memory monitoring switch in the engineering mode application of the first 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 first preset 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 second preset value. The first preset value is different from the second preset value.
[0055] 2. If it is detected that the attribute value of the memory monitoring switch is a first preset value, it is determined that the memory monitoring function is turned on.
[0056] 3. If it is detected that the attribute value of the memory monitoring switch is a second preset value, it is determined that the memory monitoring function is turned off.
[0057] It should be noted that the first preset value may be True, etc., and the second preset value may be False, etc.
[0058] In addition to using the listener to perform targeted monitoring on the attribute value of the memory monitoring switch when determining that the first operating system and the second operating system have been started, in some embodiments, the method further includes:
[0059] 1. When the target monitoring is completed, the monitor is used to monitor the change of the attribute value of the memory monitoring switch.
[0060] 2. If it is monitored that the attribute value of the memory monitoring switch changes from the first preset value to the second preset value, the memory monitoring function is turned off, and a memory monitoring function turn-off notification is sent to the second operating system, wherein the memory monitoring function turn-off notification is used to instruct the second operating system to stop obtaining the second memory usage information.
[0061] 3. If it is monitored that the attribute value of the memory monitoring switch changes from the second preset value to the first preset value, the memory monitoring function is turned on.
[0062] 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.
[0063] In some embodiments, the step of sending the information acquisition instruction to the second operating system includes:
[0064] The information acquisition instruction is sent to a communication server preset in the second operating system through a preset communication client, and the information acquisition instruction is transmitted to a system memory monitoring module preset in the second operating system via the communication server.
[0065] The information acquisition instruction is used to instruct the system memory monitoring module to obtain the second memory occupancy information using a preset memory acquisition tool, and feed back the second memory occupancy information to the communication client through the communication server.
[0066] It should be noted that the second memory occupancy information used in the step of monitoring the memory overload condition (the above-mentioned step S120) is obtained by sending the communication client. The communication client may be an FDBUS Client (Fast Data Bus Client). The communication server may be an FDBUS Server (Fast Data Bus Server). By setting an FDBUS Client in the first operating system and setting an FDBUS Server in the second operating system, efficient communication between the first operating system and the second operating system can be achieved, so that the second operating system can quickly respond to the information acquisition instruction.
[0067] It should also be noted that when the system memory monitoring module of the second operating system sends the second memory occupancy information to the first operating system, each piece of second memory occupancy information may be assembled into a json (a lightweight data exchange format) string to increase the transmission speed.
[0068] In some embodiments, the step of obtaining the memory usage target value of each application includes:
[0069] The preset target value configuration file is read to obtain the target data, wherein the target value configuration file is a file pre-burned to a designated directory of the target disk.
[0070] The target data includes: an application package name, a memory usage target value, and a system to which the application belongs. The application package name is a unique identifier of the application. The first memory usage information and the second memory usage information both carry the corresponding application package name. The application package name corresponds one-to-one to the memory usage target value. The system to which the application belongs is the first operating system or the second operating system.
[0071] Specifically, a preset target value configuration file is read, and the format of the read data is converted according to a preset data structure to obtain the target data.
[0072] It should be noted that by pre-burning the target value configuration file to the specified directory of the target disk, it is easy to read the target value configuration file to obtain the target data, which is convenient for subsequent monitoring of the memory excess of each application based on the memory occupancy target value in the target data.
[0073] It should also be noted that the target value configuration file is pre-configured with information such as the application package name, 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), the memory target value of the Android system vehicle setting application (application package name com.android.carsettig) is set to 300MB, the memory usage target value of the QNX system Cluster HMI (cluster human-machine interface) application (application package name Cluster HMI) is 200MB, and the memory usage target value of the QNX system 360 panoramic surround image application (application package name AVM) is 180MB, etc.
[0074] 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 a target disk) in a dual-system memory monitoring method provided in an 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 (the vehicle system includes the first operating system, the second operating system, and memory, etc.), so as to complete the preset of 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.
[0075] In some embodiments, the first memory occupancy information and the second memory occupancy information are periodically acquired according to a target monitoring frequency.
[0076] Specifically, the steps of obtaining first memory usage information of an application process in a first operating system and sending an information obtaining instruction to a second operating system include:
[0077] According to the target monitoring frequency, first memory occupancy information of the application process in the first operating system is regularly obtained, and an information acquisition instruction is sent to the second operating system to obtain second memory occupancy information of the application process in the second operating system.
[0078] Furthermore, the step of determining the target monitoring frequency includes:
[0079] 1. Obtaining the CPU (Central Processing Unit) usage rate of a preset system recycling thread (kswapd) and the remaining memory capacity of the first operating system.
[0080] 2. Different target monitoring frequencies are obtained according to the comparison result of the CPU usage rate with a preset usage rate threshold value, and the comparison result of the remaining memory capacity with a preset memory capacity threshold value.
[0081] Specifically, if the CPU usage is less than a preset usage threshold, and the remaining memory capacity is greater than a preset memory capacity threshold, determining the target monitoring frequency to be a first preset frequency;
[0082] If the CPU usage is greater than the usage threshold, and the remaining memory capacity is greater than the memory capacity threshold, determining the target monitoring frequency to be a second preset frequency;
[0083] If the CPU usage is less than the usage threshold, and the remaining memory capacity is less than the memory capacity threshold, determining the target monitoring frequency to be a third preset frequency;
[0084] 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, and 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.
[0085] 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 first operating system (Android system) is less than the memory capacity threshold, it means that the memory of the first operating system is insufficient 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 that when the first operating system is short of memory, the memory exceeding the standard of the first operating system and the second operating system is monitored in a timely and effective manner, so as to facilitate subsequent data analysis by relevant personnel.
[0086] 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%, the memory capacity threshold is 320MB, 330MB, etc. The first preset frequency can be 2 times / minute, the second preset frequency can be 6 times / minute, the third preset frequency can be 12 times / minute, the fourth preset frequency can be 12 times / minute, 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.
[0087] In some embodiments, the first memory usage information corresponds one-to-one to the application process in the first operating system, the second memory usage information corresponds one-to-one to the application process in the second operating system, and the memory usage target value corresponds one-to-one to the application package name; the step of monitoring the memory exceeding the limit of the application in the first operating system and the second operating system includes:
[0088] The memory occupancy value in the first memory occupancy information and the memory occupancy value in the second memory occupancy information are respectively compared with the corresponding memory occupancy target values to obtain the memory exceeding status of each application in the first operating system and the second operating system.
[0089] It should be noted that if all the application package names carried in the first memory usage information are different, and all the application package names carried in the second memory usage information are different, the memory usage value in the first memory usage information and the memory usage value in the second memory usage information will be compared with the corresponding memory usage target value respectively to obtain the memory excess situation of each application in the first operating system and the second operating system.
[0090] It should also be noted that if the application package names carried by all the first memory usage information are different, and the application package names carried by all the second memory usage information are different, it means that the applications in the first operating system and the second operating system are both single-process applications. Therefore, the memory usage value in the first memory usage information and the memory usage value in the second memory usage information are directly compared with the corresponding memory usage target values to obtain the memory excess situation of each application in the first operating system and the second operating system.
[0091] It should be mentioned that, through the above comparison steps, the memory monitoring requirements of the vehicle system can be better met.
[0092] In some embodiments, the step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes:
[0093] If there is first memory usage information or second memory usage information carrying the same application package name, the memory usage values in the first memory usage information or second memory usage information carrying the same application package name are summed and then compared with the corresponding memory usage target value.
[0094] Specifically, first, all the first memory occupation information and the second memory occupation information are traversed to obtain the application package name carried by each piece of the first memory occupation information and the application package name carried by each piece of the second memory occupation information.
[0095] Secondly, if there is first memory usage information carrying the same application package name, the memory usage values in the first memory usage information carrying the same application package name are summed to obtain the first memory usage value; and the remaining memory usage values in the first memory usage information are determined as the second memory usage values.
[0096] It should be noted that if there is first memory usage information with the same application package name, it means that the application corresponding to the application package name is a multi-process application. Therefore, the memory usage values in the first memory usage information with the same application package name are summed to obtain the first memory usage value, which is the memory usage value of the application. The applications corresponding to the remaining first memory usage information are single-process applications.
[0097] Then, if there is second memory occupancy information carrying the same application package name, the memory occupancy values in the second memory occupancy information carrying the same application package name are summed to obtain a third memory occupancy value; and the memory occupancy values in the remaining second memory occupancy information are determined as fourth memory occupancy values.
[0098] It should be noted that if there is a second memory usage information with the same application package name, it means that the application corresponding to the application package name is a multi-process application. Therefore, the memory usage values in the second memory usage information with the same application package name are summed to obtain a third memory usage value, which is the memory usage value of the application. The applications corresponding to the remaining second memory usage information are single-process applications.
[0099] Finally, the first memory occupancy value, the second memory occupancy value, the third memory occupancy value, and the fourth memory occupancy value are respectively compared with the corresponding memory occupancy target values to obtain the memory excess status of each application in the first operating system and the second operating system.
[0100] It should be noted that, through the above steps, the memory exceeding condition of each application in the first operating system and the second operating system can be well monitored, no matter the application is a multi-process application or a single-process application.
[0101] In some embodiments, the step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes:
[0102] 1. If any application has excessive memory, obtain the excessive memory information of the current application. The excessive memory information includes: the application package name, the memory usage value of the application, the target memory usage value of the application, and the system to which the application belongs, where the system to which the application belongs is the first operating system or the second operating system.
[0103] 2. Pop up an excess display interface on a preset display screen to display the memory excess information, wherein the information is displayed in order of the size of the memory usage value of the application and / or the size of the excess value of the application.
[0104] The memory excess display interface includes a first section and a second section, both of which display all the memory excess information. The memory excess information in the first section is sorted according to the size of the memory usage value of the application, and the memory excess information in the second section is sorted according to the size of the excess value of the application. The excess value refers to the difference between the memory usage value of the application and the memory usage target value.
[0105] It should be noted that the display screen may be a central control screen of an Android system, etc.
[0106] In some embodiments, when it is determined that the display screen pops up an excess display interface, or when display data in the excess display interface changes, a screenshot of the excess display interface is taken, and the screenshot image is saved to a target directory of a target disk.
[0107] It should be noted that through the above steps, it is possible to better realize timely monitoring of the memory exceeding conditions of each application in the first operating system and the second operating system, so that relevant personnel can timely understand the memory exceeding information from the display screen, and thus deal with it as soon as possible. In order to avoid the relevant personnel failing to timely understand the corresponding information due to the rapid change of the memory exceeding information displayed in the exceeding display interface, when it is determined that the exceeding display interface pops up on the display screen, or the display data in the exceeding display interface changes, the exceeding display interface is screenshotted, and the screenshot image is saved to the target directory of the target disk, which can facilitate the subsequent relevant personnel to identify and process the exceeding situation. It should be mentioned that the display method of the memory exceeding information can be a green screen with red text or other display methods, which is convenient for relevant personnel to identify.
[0108] It should be mentioned that the naming format of the screenshot image can be set according to actual conditions, such as the current time.
[0109] The following is a specific example to explain the dual system memory monitoring method in the above embodiment. Figure 3 , S310: Start the first operating system and the second operating system.
[0110] S320: Determine whether the memory monitoring function is enabled.
[0111] S330: When it is determined that the memory monitoring function is turned on, first memory usage information of the application process in the first operating system is obtained, and an information obtaining instruction is sent to the second operating system.
[0112] S340: Monitoring the memory exceeding condition of the applications in the first operating system and the second operating system according to the first memory usage information, the second memory usage information, and the pre-configured memory usage target values of the respective applications.
[0113] The dual-system memory monitoring device provided by the present invention is described below. The dual-system memory monitoring device described below and the dual-system memory monitoring method described above can be referred to each other.
[0114] Please refer to Figure 4 The dual-system memory monitoring device provided in this embodiment is arranged in the first operating system and includes:
[0115] A memory occupancy information acquisition module 410 is used to acquire first memory occupancy information of an application process in a first operating system, and send an information acquisition instruction to a second operating system, wherein the information acquisition instruction is used to instruct the second operating system to acquire second memory occupancy information and feedback the information, wherein the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system;
[0116] The monitoring module 420 is used to monitor the memory exceeding conditions of the applications in the first operating system and the second operating system according to the first memory occupancy information, the second memory occupancy information, and the pre-configured memory occupancy target values of each application, wherein the application corresponds to at least one application process, and the memory occupancy value of the application is obtained according to the memory occupancy information of the application process. The memory occupancy information acquisition module 410 is connected to the monitoring module 420. The dual-system memory monitoring device in this embodiment can monitor the memory exceeding conditions of each application in the dual system in real time, which helps relevant personnel to promptly discover the memory exceeding conditions, thereby promptly handling the memory exceeding conditions, with low cost and strong feasibility.
[0117] In some embodiments, it also includes: a function status detection module, which is used to monitor the on and off status of the memory monitoring function using a pre-registered listener.
[0118] In some embodiments, the memory occupancy information acquisition module 410 is specifically used to send the information acquisition instruction to the communication server preset in the second operating system through a preset communication client, and the information acquisition instruction is transmitted to the system memory monitoring module preset in the second operating system via the communication server.
[0119] In some embodiments, it also includes: a target value acquisition module, which is used to read a preset target value configuration file to obtain target data.
[0120] In some embodiments, it further includes: a target monitoring frequency determination module, which is used to obtain the CPU usage rate of the preset system recycling thread and the remaining memory capacity of the first operating system;
[0121] Different target monitoring frequencies are obtained according to the comparison result of the CPU usage rate with a preset usage rate threshold value, and the comparison result of the remaining memory capacity with a preset memory capacity threshold value.
[0122] In some embodiments, the monitoring module 420 is specifically used to compare the memory occupancy value in the first memory occupancy information and the memory occupancy value in the second memory occupancy information with the corresponding memory occupancy target value respectively to obtain the memory excess status of each application in the first operating system and the second operating system.
[0123] In some embodiments, the monitoring module 420 is also specifically used to sum the memory usage values in the first memory usage information or the second memory usage information carrying the same application package name, and then compare them with the corresponding memory usage target value if there is a first memory usage information or a second memory usage information carrying the same application package name.
[0124] In some embodiments, the monitoring module 420 is further specifically used to obtain the memory exceeding limit information of the current application if any application has a memory exceeding limit;
[0125] An excess display interface pops up on a preset display screen to display the memory excess information on the excess display interface, wherein the information is displayed in order of the size of the memory usage value of the application and / or the size of the excess value of the application.
[0126] In some embodiments, the monitoring module 420 is also specifically used to take a screenshot of the excess display interface and save the screenshot image to a target directory of the target disk when it is determined that the excess display interface pops up on the display screen or the display data in the excess display interface changes.
[0127] This embodiment also provides a vehicle-mounted system, including: a first operating system and a second operating system, wherein the first operating system is used to run the dual-system memory monitoring method as described in any of the above. The vehicle-mounted system in this embodiment can achieve the beneficial effects achieved by any of the above embodiments.
[0128] Figure 5 For a schematic diagram of the structure of a vehicle-mounted system provided by an embodiment of the present invention, please refer to Figure 5 , the first operating system includes the dual-system memory monitoring device and FDBUS Client (fast data bus client) as described above. The second operating system includes a system memory monitoring module and an FDBUS Server (fast data bus server). The dual-system memory monitoring device, FDBUS Client, FDBUS Client, and the system memory monitoring module are connected in sequence. In addition, the vehicle-mounted system also includes a Hypervisor (virtual machine monitor) and a SOC (System on Chip) chip, etc. The Hypervisor includes a memory and a virtual machine communication module, etc. The dual-system memory monitoring device and the system memory monitoring module are respectively connected to the memory, and the FDBUS Client and the FDBUS Client are respectively connected to the virtual machine communication module.
[0129] This embodiment further provides a vehicle, comprising: the vehicle-mounted system as described above. The vehicle in this embodiment can achieve the beneficial effects described in any of the above embodiments.
[0130] In some embodiments, an electronic device is also provided, which may be a server, and its internal structure is shown in FIG. Figure 6As 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.
[0131] 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. When the processor executes the computer program, the following steps are implemented: obtaining first memory occupancy information of an application process, and sending an information acquisition instruction to a second operating system, the information acquisition instruction being used to instruct the second operating system to obtain second memory occupancy information and provide feedback, the second memory occupancy information referring to the memory occupancy information of the application process in the second operating system; monitoring the memory excess of each application in the first operating system and the second operating system based on the first memory occupancy information, the second memory occupancy information, and pre-configured memory occupancy target values of each application, the application corresponding to at least one application process, and the memory occupancy value of the application being obtained based on the memory occupancy information of the application process of the application.
[0132] 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 first memory occupancy information of an application process, and sending an information acquisition instruction to a second operating system, the information acquisition instruction is used to instruct the second operating system to obtain second memory occupancy information and feedback, the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system; based on the first memory occupancy information, the second memory occupancy information, and the pre-configured memory occupancy target values of each application, the memory exceeding condition of each application in the first operating system and the second operating system is monitored, the application corresponds to at least one application process, and the memory occupancy value of the application is obtained based on the memory occupancy information of the application process of the application.
[0133] 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.
[0134] 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.
[0135] 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 dual system memory monitoring method, applied to a first operating system, characterized in that: include: Acquire first memory occupancy information of the application process, and send an information acquisition instruction to the second operating system, wherein the information acquisition instruction is used to instruct the second operating system to acquire second memory occupancy information and feedback it, wherein the second memory occupancy information refers to the memory occupancy information of the application process in the second operating system; The first operating system and the second operating system are located in the same vehicle-mounted system; Monitoring the memory exceeding condition of the applications in the first operating system and the second operating system according to the first memory usage information, the second memory usage information, and the pre-configured memory usage target values of the applications, wherein the application corresponds to at least one application process, and the memory usage value of the application is obtained according to the memory usage information of the application process of the application; The prerequisite for obtaining the first memory occupancy information of the application process and sending the information acquisition instruction to the second operating system is to determine that the memory monitoring function is turned on; wherein the on / off state of the memory monitoring function is monitored by using a pre-registered listener; Monitoring the on / off state of the memory monitoring function using a pre-registered listener includes: using the listener to perform targeted monitoring of the attribute value of the memory monitoring switch to determine the on / off state of the memory monitoring function, the memory monitoring switch being a preset system attribute; The step of sending an information acquisition instruction to the second operating system comprises: The information acquisition instruction is sent to a communication server preset in the second operating system through a preset communication client, and the information acquisition instruction is transmitted to a system memory monitoring module preset in the second operating system via the communication server; The information acquisition instruction is used to instruct the system memory monitoring module to obtain the second memory occupancy information using a preset memory acquisition tool, and feed back the second memory occupancy information to the communication client through the communication server.
2. The dual system memory monitoring method according to claim 1, characterized in that: The step of obtaining the target memory usage value of each application includes: Reading a preset target value configuration file to obtain target data, wherein the target value configuration file is a file pre-burned to a designated directory of a target disk; The target data includes: an application package name, a memory usage target value, and a system to which the application belongs. The application package name is a unique identifier of the application. The first memory usage information and the second memory usage information both carry the corresponding application package name. The application package name corresponds one-to-one to the memory usage target value. The system to which the application belongs is the first operating system or the second operating system.
3. The dual system memory monitoring method according to claim 1, characterized in that: The first memory occupancy information and the second memory occupancy information are periodically acquired according to a target monitoring frequency; Wherein, the step of determining the target monitoring frequency includes: Obtaining a CPU usage rate of a preset system recycling thread and a remaining memory capacity of the first operating system; Different target monitoring frequencies are obtained according to the comparison result of the CPU usage rate with a preset usage rate threshold value, and the comparison result of the remaining memory capacity with a preset memory capacity threshold value.
4. The dual system memory monitoring method according to claim 1, characterized in that: The step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system includes: The memory occupancy value in the first memory occupancy information and the memory occupancy value in the second memory occupancy information are respectively compared with the corresponding memory occupancy target values to obtain the memory exceeding status of each application in the first operating system and the second operating system.
5. The dual system memory monitoring method according to claim 4, characterized in that: The step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes: If there is first memory usage information or second memory usage information carrying the same application package name, the memory usage values in the first memory usage information or second memory usage information carrying the same application package name are summed and then compared with the corresponding memory usage target value.
6. The dual system memory monitoring method according to claim 4 or 5, characterized in that: The step of monitoring the memory exceeding limit of applications in the first operating system and the second operating system further includes: If any application has excessive memory, obtain the memory excess information of the current application; An excess display interface pops up on a preset display screen to display the memory excess information, wherein the information is displayed in order of the size of the memory usage value of the application and / or the size of the excess value of the application.
7. The dual system memory monitoring method according to claim 6, characterized in that: When it is determined that the display screen pops up the excess display interface, or the display data in the excess display interface changes, a screenshot of the excess display interface is taken, and the screenshot image is saved to a target directory of the target disk.
8. A vehicle-mounted system, characterized in that: include: A first operating system and a second operating system, wherein the first operating system is used to run the dual-system memory monitoring method according to any one of claims 1 to 7.
9. A vehicle, characterized in that: include: The vehicle-mounted system as claimed in claim 8.
10. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the dual system memory monitoring method as described in any one of claims 1 to 7.
11. 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 dual-system memory monitoring method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Memory cleaning method and device
CN105389245A
Method for determining memory recovery threshold and related equipment
CN114168490A
Memory monitoring method and device, electronic equipment and storage medium
CN118152229A
Memory monitoring method and device
CN118708388A