A method and system for managing dynamic log levels based on a head unit system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]在现有车机系统中,日志等级通常在开发阶段通过编译时设定或固定配置文件进行管理,一旦部署至车机,用户或开发者难以动态调整日志等级
[0009]与现有技术相比,采用该技术方案所达到的技术效果:将执行修改指令的配置文件明确标记为修改文件,并由GEM系统直接将修改等级输入其中,解决了修改等级信息存储不明确的问题,在车机系统重启后,等级管理模块能够精确地从这些修改文件中读取配置等级,避免了读取到旧的或错误的等级信息。显著提升了车机系统动态日志等级管理的准确性和可靠性,使得用户对日志等级的调整能够真正生效,从而有效避免了日志输出混乱,提高了系统维护和故障排查的效率。
Smart Images

Figure CN122547598A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle software debugging technology, and more specifically, to a method and system for managing dynamic log levels based on vehicle infotainment systems. Background Technology
[0002] In existing in-vehicle infotainment systems, log levels are typically managed during the development phase through compile-time settings or fixed configuration files. Once deployed to the vehicle, users or developers find it difficult to dynamically adjust log levels. Some systems allow modification of log levels via specific command-line parameters, but this is complex. Furthermore, existing systems have weak protection mechanisms for configuration files, making them susceptible to abnormal tampering and resulting in chaotic log output. Summary of the Invention
[0003] The problem this invention addresses is: how to provide a management method for dynamically adjusting log levels.
[0004] To address the aforementioned issues, this invention provides a method for managing dynamic log levels based on a vehicle infotainment system (VMS). The method includes: receiving user operation commands to enter the GEM system; modifying the current level of the configuration file according to the user's modification commands to obtain a modified level; comparing the current level of the configuration file with the configured level in the GEM system after the VMS restarts; when the current level and the configured level are consistent, reading the modified level through the level management module and configuring the modified level in other modules; when the current level and the configured level are inconsistent, determining the validity of the configuration file through a health check module; if the configuration file is valid, regenerating the configuration file according to the configured level; if the configuration file is invalid, immediately triggering a rollback mechanism.
[0005] Compared to existing technologies, this technical solution achieves the following advantages: After the vehicle infotainment system restarts, a comparison mechanism is introduced between the current configuration file level and the configuration level in the GEM system. This allows for the timely detection of any unexpected changes or tampering to the configuration file during the restart process. Even if the configuration file is accidentally modified during a restart, the system can detect inconsistencies through comparison, rather than blindly loading incorrect configurations. This avoids the impact of abnormal configuration file modifications, significantly enhances configuration reliability, and ensures the stable operation of the vehicle infotainment system.
[0006] In one embodiment of the present invention, the user's operation command is received to enter the GEM system, and the current level of the configuration file is modified according to the user's modification command to obtain the modified level. Specifically, this includes: long-pressing a specific position on the vehicle screen to enter the GEM system; the GEM configuration interface displays the current level of each configuration file, as well as the setting range and modification range of the current level; when the user's modification command is within the modification range, the current level is adjusted according to the modification command to obtain the modified level; when the user's modification command is outside the modification range, the threshold value of the modification range is used as the modified level according to the user's modification intention.
[0007] Compared with existing technologies, the technical effects achieved by this solution are as follows: By setting a specific method for accessing the GEM system, the process of users entering the log level modification interface is simplified, avoiding complex command-line input. The settings for the current level, setting range, and modification range of each configuration file ensure that all log level modifications are performed within a reasonable and safe range. When the user's modification command is within the modification range, the system can flexibly respond to the user's needs. When the command exceeds the modification range, the system will automatically take the threshold value as the modification level based on the user's modification intention. This not only avoids log output chaos that may be caused by unreasonable configuration but also preserves the user's modification intent to the greatest extent, ensuring that the log level is always kept within a safe and reasonable range, and avoiding system instability or log information overload that may be caused by extreme settings.
[0008] In one embodiment of the present invention, when the current level and the configuration level are consistent, the level management module reads the modified level and configures the modified level into other modules. Specifically, this includes: recording the configuration file that executes the modification command as the modification file, and the GEM system inputting the modified level into the modification file; after the vehicle system restarts, the level management module reads the configuration level from the modification file and sets the configuration level into the associated module corresponding to the modification file.
[0009] Compared to existing technologies, this technical solution achieves the following advantages: The configuration file executing the modification command is explicitly marked as a modification file, and the GEM system directly inputs the modification level into it. This solves the problem of ambiguous modification level information storage. After the vehicle system restarts, the level management module can accurately read the configuration level from these modification files, avoiding the reading of old or incorrect level information. This significantly improves the accuracy and reliability of dynamic log level management in the vehicle system, ensuring that user adjustments to the log level truly take effect. This effectively avoids log output chaos and improves the efficiency of system maintenance and troubleshooting.
[0010] In one embodiment of the present invention, after the vehicle system restarts, the level management module reads the configuration level from the modification file and sets the configuration level to the associated module corresponding to the modification file. Specifically, this includes: when the vehicle system restarts, counting the number of modules that need to be modified by the modification instruction, determining the execution order of the modification instruction according to the priority of each module; integrating the associated modules according to the configuration level, and adjusting the associated modules according to the execution order and the modification level.
[0011] Compared to existing technologies, this technical solution achieves the following advantages: By statistically analyzing the modules involved in the modification instructions and determining their execution order based on priority during vehicle system restarts, it ensures that the log level configuration of critical modules is completed first, avoiding the impact of abnormal configurations of low-priority modules on core functions. Simultaneously, the integration of related modules and adjustments according to the execution order avoids mismatches or omissions that may result from piecemeal adjustments, significantly improving the stability and accuracy of multi-module log level modifications, thereby guaranteeing the normal operation and overall reliability of the vehicle system's logging function.
[0012] In one embodiment of the present invention, associated modules are integrated according to configuration level, and associated modules are adjusted according to execution order and modification level. Specifically, when an associated module has only one modification level, the associated module is adjusted according to the modification level; when an associated module has multiple modification levels, the associated module does not need to be adjusted, and the user is notified of the abnormal command.
[0013] Compared to existing technologies, this technical solution achieves the following effects: by distinguishing between cases where an associated module has only one modification level and cases where multiple modification levels exist, it avoids log level configuration errors caused by configuration conflicts, thereby preventing abnormal log output and ensuring the stable operation of the vehicle's infotainment system. When a configuration conflict is detected, no adjustments are made, and the user is promptly notified, enabling the user to quickly identify and correct abnormal operations, thus improving the user experience.
[0014] In one embodiment of the present invention, when the current level and the configuration level are inconsistent, the validity of the configuration file is determined by the health detection module. Specifically, the health detection module obtains the log buffer occupancy rate and log output frequency through real-time scanning; and determines the validity of the configuration file based on the log buffer occupancy rate and log output frequency.
[0015] Compared to existing technologies, this technical solution achieves the following advantages: The validity judgment mechanism prevents problematic configurations from being blindly applied when configuration levels are inconsistent. Real-time scanning of log buffer occupancy and log output frequency settings accurately assesses the actual impact of configuration files and promptly identifies invalid configurations that, even if syntactically correct, may lead to system resource exhaustion or log function malfunction. This effectively avoids log system crashes, storage space exhaustion, or loss of critical information caused by misconfigurations, significantly improving the stability and reliability of the vehicle's infotainment system and ensuring the normal operation of the log function.
[0016] In one embodiment of the present invention, if the configuration file is invalid, a rollback mechanism is immediately triggered, which includes: freezing the modified file; reading the most recent valid configuration snapshot from the independent security partition and overwriting the modified file; after the modified file is overwritten, generating a security audit log to record the abnormal time, the module where the abnormality occurred, and the recovery operation.
[0017] Compared to existing technologies, this technical solution achieves the following effects: freezing modified file settings effectively isolates the impact of abnormal configurations; effectively overwriting configuration snapshots ensures the security and validity of restored data, avoiding a simplistic revert to factory settings; and generating security audit logs provides a traceable basis for subsequent troubleshooting and system maintenance. While minimizing the impact of invalid configurations, it also ensures the stability of the vehicle's infotainment system configuration.
[0018] In one embodiment of the present invention, if the configuration file is valid, the configuration file is regenerated according to the configuration level. The method further includes: when the configuration file does not exist, the user needs to delete the original configuration file and modify the file with the same name in a different path; after the modification is completed, the vehicle system is restarted. When the vehicle system detects that the original configuration file does not exist, it will read the configuration file manually configured by the user.
[0019] Compared to existing technologies, this technical solution achieves the following effects: by deleting the original configuration file and modifying files with the same name in different paths, it ensures the purity of the configuration environment and avoids conflicts between old and new configurations. Combined with the detection mechanism after system restart, it can intelligently identify missing configuration files and seamlessly switch to reading manually configured configuration files, thereby ensuring the smooth completion of log level modifications and significantly improving the stability and reliability of the vehicle system's log level management.
[0020] In one embodiment of the present invention, the vehicle system adopts a three-level configuration loading strategy: first, it reads the configuration file; if the configuration file exists and passes the verification, it is loaded directly; if the configuration file is damaged or missing, it automatically switches to the safe backup area to read the baseline configuration; when the safe backup area is also damaged, the vehicle system has a built-in default security policy and loads the factory preset configuration through the default security policy.
[0021] Compared to existing technologies, the technical advantages of this solution are as follows: The three-level configuration loading strategy ensures that the log system maintains a usable configuration state under all circumstances, improving the reliability and security of dynamic log level management. Even in extreme scenarios where both user-defined and backup configurations fail, the system can load the factory default configuration through the built-in default security policy, avoiding the risk of complete log system failure, effectively preventing log output chaos, and providing a solid foundation for fault diagnosis and system maintenance.
[0022] In one embodiment of the present invention, this application also provides a management system for dynamic log levels based on a vehicle infotainment system. The management method described in the above embodiments is applied to the management system. The management system includes: a receiving module for receiving operation instructions to enter the GEM system; a comparison module for comparing the current level and the configuration level; a storage module for storing the configuration file; and a judgment module for judging whether the configuration file is valid. The management system has all the technical features of the above management method, which will not be described in detail here. Attached Figure Description
[0023] Figure 1 This is one of the flowcharts for the dynamic log level management method based on the vehicle infotainment system in this application; Figure 2 This is the second flowchart of the dynamic log level management method based on the vehicle system in this application; Figure 3 This is the third flowchart of the management method for dynamic log levels based on the vehicle infotainment system in this application; Figure 4 This is the fourth flowchart of the dynamic log level management method based on the vehicle system in this application; Figure 5 This is a system diagram of the dynamic log level management system based on the vehicle infotainment system in this application; Explanation of reference numerals in the attached figures: 100. Management System; 110. Receiving Module; 120. Comparison Module; 130. Storage Module; 140. Judgment Module. Detailed Implementation
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0025] [First Embodiment] See Figure 1 In one specific embodiment, this application provides a management method for dynamic log levels based on a vehicle infotainment system. The management method includes: S100: Receive user's operation instructions and enter the GEM system; modify the current level of the configuration file according to the user's modification instructions to obtain the modified level. After the S200 vehicle system restarts, it compares the current level of the configuration file with the configuration level in the GEM system. S300: When the current level and the configured level are consistent, the level is read and modified through the level management module, and the modified level is configured in other modules; S400: When the current level and the configuration level are inconsistent, the validity of the configuration file is determined through the health detection module. S500: If the configuration file is valid, regenerate the configuration file according to the configuration level. S600: If the configuration file is invalid, the rollback mechanism will be triggered immediately.
[0026] In step S100, the vehicle interface has a specific icon. After the user presses and holds the icon, they can enter the GEM system. The methods for modifying the current level include, but are not limited to, text box input and dragging the progress bar. After the user completes the operation, the user's operation content is used as the modification instruction to complete the user's initial adjustment of the log level.
[0027] In step S200, after the vehicle system completes the restart operation, it actively reads the log level recorded in the currently effective configuration file, i.e., the current level. Simultaneously, it retrieves the configuration level representing the user's modification intent from the GEM system, i.e., the modification level. Then, it compares the modification level with the current level to determine whether the configuration file underwent unexpected changes during the restart process, or whether the user's modification intent was correctly preserved.
[0028] In step S300, when the current level and the configured level are consistent, it indicates that the user's modification intention has been successfully executed and the restart did not cause any issues. At this point, the level management module will be activated and responsible for reading this confirmed modification level from the configuration file. Subsequently, this module will distribute and apply this modification level to all associated modules in the vehicle system that require log level configuration, ensuring that the log output behavior of the entire system is consistent with the user's expectations.
[0029] For example, if a user changes the log level to DEBUG, the level management module will apply the DEBUG level to all components that require log output, such as the navigation module, entertainment module, and vehicle control module.
[0030] In step S400, if there is a difference between the current level and the configuration level, it indicates that the configuration file has been tampered with, damaged, or not updated correctly. At this time, the vehicle system will not directly apply any level, but will start the health detection module to check the contents, including but not limited to file integrity verification and format legality check. The check determines whether the configuration file is a valid file that is usable but has incorrect content, or an unusable file that is completely damaged or invalid.
[0031] In steps S500 and S600, if the health detection module determines that the configuration file, although inconsistent in content, still has a valid structure and format, the vehicle system will take corrective measures. Based on the correct configuration level information stored internally in the GEM system, it will reconstruct and generate a new configuration file. This newly generated configuration file will replace the original inconsistent configuration file, thereby correcting the configuration error and restoring the system to the correct configuration state.
[0032] If the health detection module determines that the configuration file is completely unusable, the vehicle system will immediately initiate a rollback mechanism to restore the vehicle system configuration to the most recent stable and valid state, in order to avoid system instability or log output chaos caused by invalid configuration files.
[0033] After the vehicle infotainment system restarts, a mechanism is introduced to compare the current configuration file level with the configuration level in the GEM system. This mechanism can promptly detect any unexpected changes or tampering to the configuration file that may occur during the restart process. Even if the configuration file is accidentally modified during a restart, the system can detect inconsistencies through comparison, rather than blindly loading incorrect configurations. This avoids the impact of abnormal configuration file modifications, significantly enhances configuration reliability, and ensures the stable operation of the vehicle infotainment system.
[0034] See Figure 2 Furthermore, the system receives user commands to access the GEM system, modifies the current level of the configuration file according to the user's modification instructions, and obtains the modification level, specifically including: S110. Press and hold a specific location on the vehicle's infotainment screen to enter the GEM system. The GEM configuration interface displays the current level of each configuration file, as well as the setting range and modification range of the current level. S120. When the user's modification instruction is within the modification range, adjust the current level according to the modification instruction to obtain the modification level; S130. When the user's modification instruction is outside the modification range, the threshold value of the modification range shall be used as the modification level according to the user's modification intention.
[0035] In steps S110 to S130, during the modification of some log levels, there is no range restriction on the user's modification operation. The user may input a log level that exceeds the reasonable range, resulting in subsequent log output that does not meet the requirements, or even causing system abnormalities.
[0036] A specific location on the vehicle's infotainment screen can be preset as a fixed area, such as the upper left corner, lower right corner, or a virtual button area. Users can press and hold this area for a preset duration, usually 2-5 seconds, to avoid accidentally entering the GEM system.
[0037] Preferably, the GEM system can also use a combination of button operations, such as pressing and holding the volume up button and a certain area of the screen at the same time.
[0038] Upon entering the GEM configuration interface, the GEM system clearly displays the current log level of each configuration file, along with the setting range and allowed modification range for that level. Each log level can be displayed next to a slider, drop-down menu, or input box for adjusting the level. The setting and modification ranges can be indicated through text prompts, such as entering a value from 0 to 5 in a text box, or visually through the minimum and maximum values of the slider.
[0039] When a user issues a modification command, the GEM system will verify the command. If the user's modification command falls within the preset modification range, the GEM system will directly adopt the command and adjust the current level accordingly to obtain the final modification level.
[0040] When a user selects or enters a value through an input box on the interface, the system immediately checks whether the value is within the predefined modification range. If it meets the requirements, the value is set as the new modification level.
[0041] To prevent unreasonable configurations that may cause system malfunctions, when a user's modification command exceeds the preset modification range, the system will not directly reject the command. Instead, it will automatically use the threshold value of the modification range as the final modification level based on the user's modification intention.
[0042] If the user's input modification command exceeds the upper limit of the modification range, the system will use the upper limit of the modification range as the modification level. If the user's input modification command is lower than the lower limit of the modification range, the system will use the lower limit of the modification range as the modification level.
[0043] Preferably, when the GEM system detects input that is out of range, it can pop up a prompt box to inform the user that the input is invalid and automatically set the value of the input box to the closest threshold value, or provide an option for the user to choose whether to accept the threshold value.
[0044] For example, suppose the current level of the engine control unit (ECU) log in the vehicle's infotainment system is 2. In the GEM configuration interface, the setting range for this ECU log is defined as 0 to 5, while the allowed modification range is limited to ±1 of the current level, i.e., 1 to 3. If a user wishes to adjust the ECU log level, they can first successfully enter the GEM system by pressing and holding a preset virtual button in the lower right corner of the vehicle's infotainment screen for about 3 seconds.
[0045] In the GEM configuration interface, users will see a list containing ECU log entries, displaying their current level as 2. Next to each entry, the system clearly indicates that the setting range is between 0 and 5, and the modification range is between 1 and 3. If the user adjusts the ECU log level to 3 using the slider on the interface, the system will directly accept this modification command and set the modified level to 3. Subsequently, the modified level 3 will be written to the corresponding configuration file. However, if the user attempts to adjust the ECU log level to 0, the system will not directly reject the user's operation. Instead, based on the user's modification intention (i.e., wanting to lower the log level), it will set the final modified level to the lower limit of the modification range, 1. Understandably, if the user attempts to adjust the log level to 4, the system will adjust it to the upper limit of the modification range, 3.
[0046] By specifying the method for accessing the GEM system, the process for users to enter the log level modification interface is simplified, avoiding complex command-line input. The settings for the current level, setting range, and modification range of each configuration file ensure that all log level modifications are performed within a reasonable and safe range. When the user's modification command is within the modification range, the system can flexibly respond to the user's needs. When the command exceeds the modification range, the system automatically takes the threshold value as the modification level based on the user's modification intention. This not only avoids log output chaos that may be caused by unreasonable configuration but also preserves the user's modification intent to the greatest extent, ensuring that the log level always remains within a safe and reasonable range, and preventing system instability or log information overload that may be caused by extreme settings.
[0047] Furthermore, when the current level and the configured level are consistent, the modified level is read through the level management module, and the modified level is configured in other modules, specifically including: S310. Record the configuration file for executing the modification command as the modification file, and the GEM system will input the modification level into the modification file; S320. After the vehicle infotainment system restarts, the level management module reads the configuration level from the modified file and sets the configuration level to the associated module corresponding to the modified file. In steps S310 to S320, the vehicle infotainment system needs to accurately identify and process the configuration files that have been modified by the user. When a user modifies and saves a configuration file through the GEM system, the system adds a specific marker to that configuration file.
[0048] Preferably, the vehicle system can maintain a version control for each configuration file. When a configuration file is modified, its status will be updated to "modified", and the modification timestamp and modifier information will be recorded.
[0049] After the user completes the log level adjustment in the GEM configuration interface, the GEM system will directly write the new log level value, i.e. the modified level, to the configuration file marked as modified.
[0050] After the vehicle infotainment system restarts, it can accurately obtain the log level that the user last modified and saved. At the initial startup of the vehicle infotainment system, the level management module will proactively scan or be notified to access the preset configuration file storage path, identifying configuration files marked as modified. Subsequently, it parses the modified files, extracts the user-set configuration level, and then calls the API interface provided by the associated module or sends a specific message to pass the new configuration level to that module, thereby dynamically adjusting the module's log output behavior.
[0051] By explicitly marking the configuration files for which modification commands are executed as modified files, and having the GEM system directly input the modification level into them, the problem of ambiguous modification level information storage is resolved. After the vehicle system restarts, the level management module can accurately read the configuration level from these modified files, avoiding the reading of outdated or incorrect level information. This significantly improves the accuracy and reliability of dynamic log level management in the vehicle system, ensuring that user adjustments to log levels truly take effect, thereby effectively preventing log output chaos and improving the efficiency of system maintenance and troubleshooting.
[0052] Furthermore, after the vehicle system restarts, the level management module reads the configuration level from the modified file and sets the configuration level to the associated module corresponding to the modified file, specifically including: S321. When the vehicle system restarts, count the number of modules that need to be modified by the modification command, and determine the execution order of the modification command according to the priority of each module; S322. Integrate related modules according to configuration level, and adjust related modules according to execution order and modification level.
[0053] In step S321, the statistical modification instructions determine the overall scope of this log level adjustment, identify all affected related modules, and provide basic data for subsequent orderly adjustments. The vehicle system extracts and counts all related module identifiers involved in the log level adjustment by parsing the user's modification instruction log in the GEM system.
[0054] Setting priority ensures that log level configurations for critical modules are completed first, preventing configuration anomalies in low-priority modules from affecting core functions and improving the stability and resilience of the configuration process. The vehicle infotainment system can maintain a predefined list of module priorities. For example, modules related to driving safety (such as ADAS and powertrain) can be set to high priority, navigation and communication modules to medium priority, and entertainment and comfort modules to low priority.
[0055] Preferably, the priority setting can also be dynamic, calculating or adjusting the priority of the module in real time based on the current running status of the module, system load or user configuration mode, and determining the execution order accordingly.
[0056] In step S322, all related modules to be adjusted and their corresponding configuration level information are organized and categorized. The vehicle system creates a temporary data structure containing the identifier of each related module to be adjusted and its corresponding target modification level. Following a pre-planned execution order, the user-desired modification level is accurately applied to each related module. The level management module calls the log level setting interface of each related module one by one according to the determined execution order, writing the corresponding modification level into the module's internal configuration or runtime parameters.
[0057] For example, when a user modifies the log levels of the ADAS, navigation, and entertainment modules through the GEM system, the vehicle's infotainment system, upon restarting, first scans the modification logs or specific configuration change records generated by the GEM system to determine the number of modules requiring log level adjustments for this restart, identifying the ADAS, navigation, and entertainment modules. Then, based on a preset module priority list (which prioritizes ADAS modules highest, navigation modules second, and entertainment modules lowest), the execution order of the modification commands is determined as follows: adjust the ADAS module first, then the navigation module, and finally the entertainment module. The modification commands are to set the ADAS module to DEBUG, the navigation module to INFO, and the entertainment module to WARN. The log level management module will then follow this determined execution order, first sending a DEBUG log level configuration command to the ADAS module, then an INFO log level configuration command to the navigation module, and finally a WARN log level configuration command to the entertainment module, thus completing the log level adjustments for all related modules.
[0058] By statistically analyzing the modules involved in modification commands and determining their execution order based on priority during vehicle system restarts, it is possible to ensure that the log level configuration of critical modules is completed first, avoiding the impact of abnormal configurations of low-priority modules on core functions. Simultaneously, the integration of related modules and adjustments according to the execution order avoid mismatches or omissions that may result from piecemeal adjustments, significantly improving the stability and accuracy of multi-module log level modifications, thereby guaranteeing the normal operation and overall reliability of the vehicle system's logging function.
[0059] Furthermore, related modules are integrated according to configuration levels, and adjusted according to execution order and modification level, specifically including: S322a. When an associated module has only one modification level, the associated module shall be adjusted according to the modification level. S322b When an associated module has multiple modification levels, the associated module does not need to be adjusted, and the user is notified of the abnormal command.
[0060] In steps S322a to S322b, traditional vehicle infotainment systems do not consider the situation where a single associated module may correspond to multiple modification commands and thus multiple modification levels when dynamically configuring log levels. This can easily lead to configuration conflicts, abnormal log output, and affect the normal operation of the vehicle infotainment system.
[0061] After the vehicle system restarts, when the level management module reads the configuration level from the modification file and prepares to set it to the associated modules, it first counts the number of modification levels corresponding to each associated module. If an associated module corresponds to only one modification level, it means that the modification is clear, and the associated module is directly adjusted according to the modification level to ensure the accuracy of the log level configuration. However, if an associated module is detected to correspond to multiple different modification levels, this usually means that the user has performed multiple conflicting modification operations, or there are other abnormal situations. In this case, to avoid introducing incorrect configurations that could lead to chaotic log output or system instability, the system will not make any adjustments to the associated module, but will immediately issue an abnormal command notification to the user.
[0062] For example, the navigation module, as an associated module, can have its log level dynamically adjusted via a configuration file. When a user modifies the navigation module's log level through the GEM system and saves it as INFO, after the vehicle's infotainment system restarts, the log management module, when processing the navigation module's configuration, finds that the navigation module only corresponds to one modification level, INFO. At this point, it adjusts the navigation module based on this INFO level, setting its log output level to INFO so that it only records logs at the information level and above.
[0063] If a user makes two different changes to the navigation module's log level within a short period—for example, changing it to DEBUG the first time and WARNING the second time—and both changes are recorded in the modification file before the vehicle system restarts, the log level management module will detect two different modification levels (DEBUG and WARNING) when processing the navigation module's configuration after the system restarts. In this case, the system will determine that multiple modification levels exist and therefore will not adjust the navigation module's log level. Instead, it will display a message on the vehicle screen informing the user that there is a conflict in the navigation module's log level configuration and requesting them to check and reconfigure it, guiding the user to correct the issue.
[0064] By distinguishing between cases where an associated module has only one modification level and cases where multiple modification levels exist, log level configuration errors caused by configuration conflicts can be avoided, thus preventing abnormal log output and ensuring the stable operation of the vehicle's infotainment system. When a configuration conflict is detected, no adjustments are made, and the user is promptly notified, enabling the user to quickly identify and correct abnormal operations, thereby improving the user experience.
[0065] See Figure 3 Furthermore, when the current level and the configuration level are inconsistent, the validity of the configuration file is determined through the health check module, specifically including: S410, the health detection module obtains the log buffer occupancy rate and log output frequency through real-time scanning; S420. Determine the validity of the configuration file based on the log buffer occupancy rate and log output frequency.
[0066] In step S410, the real-time scanning refers to the health detection module monitoring and collecting system status parameters at a high frequency. It queries the log buffer status and log output counter at fixed time intervals via the API interface provided by the operating system. Log buffer occupancy reflects the ratio of space used by log data in the dedicated storage area to the total space. An unusually high occupancy rate may indicate excessive log output or slow log write speeds, suggesting potential problems with the log configuration. This occupancy rate can be obtained by reading memory usage statistics provided by the operating system or log management framework. Generally, a log buffer occupancy rate exceeding 90% is considered invalid.
[0067] Log output frequency represents the number of log entries or the amount of log data generated by the system per unit of time. Abnormal fluctuations in log output frequency, such as a sudden spike or drop during normal operation, may signal incorrect modification of the log configuration or a system malfunction. It is calculated by counting the number of log messages or bytes generated by the logging system within a specific time window. Determining the validity of the configuration file involves evaluating whether the current log configuration file meets expectations and whether it will lead to system anomalies or resource exhaustion based on collected log operation status parameters. Generally, a log output frequency exceeding a certain multiple of the normal range is considered invalid.
[0068] The validity assessment mechanism prevents problematic configurations from being blindly applied when configuration levels are inconsistent. Real-time scanning of log buffer occupancy and log output frequency settings accurately assesses the actual impact of configuration files, promptly identifying invalid configurations that, even if syntactically correct, may lead to system resource exhaustion or log function malfunction. This effectively avoids log system crashes, storage space exhaustion, or loss of critical information caused by misconfigurations, significantly improving the stability and reliability of the vehicle infotainment system and ensuring the normal operation of the logging function.
[0069] See Figure 4 Furthermore, if the configuration file is invalid, a rollback mechanism is immediately triggered, specifically including: S610, Freeze modified files; S620: Read the most recent valid configuration snapshot from the independent security partition and overwrite the modified files; S630. After a modified file is overwritten, a security audit log is generated, recording the time of the exception, the module where the exception occurred, and the recovery operation.
[0070] In step S610, freezing modified files involves locking modified files that contain abnormalities to prevent them from continuing to affect other modules of the system, thereby controlling the scope of the abnormality, preventing the abnormality from spreading further, and creating a stable execution environment for subsequent rollback operations.
[0071] Freezing can utilize operating system-level file locking mechanisms to prevent other processes from accessing or modifying the file before a rollback is complete. Alternatively, it can intercept all read and write requests to the file at the file system driver level, ensuring the content is not further tampered with.
[0072] In step S620, the independent security partition is an isolated storage area that is protected from the impact of routine system operations, thus ensuring the security and validity of the configuration snapshots stored within it. This partition has independent access permissions and a strict verification mechanism to prevent unauthorized access or tampering. The vehicle system automatically creates copies of configuration files during periodic checks or after successful modifications to critical configurations. These copies are timestamped and contain verification information, ensuring their integrity and validity. The modifications are overwritten by directly deleting the original modified file and then copying and renaming the snapshot file to the modified file.
[0073] In step S630, to provide traceable records of exception handling, the modified files may write this log information to the system log file and mark it as a security event for quick identification by system administrators or developers. The log content includes, but is not limited to, the system timestamp when the exception occurred, the identifier of the module that caused the exception, and a detailed description of the recovery operation performed.
[0074] Freezing modified files effectively isolates the impact of abnormal configurations. The effective snapshot overwriting operation ensures the security and validity of restored data, avoiding a simplistic revert to factory settings. The configuration for generating security audit logs provides a traceable basis for subsequent troubleshooting and system maintenance. While minimizing the impact of invalid configurations, it also ensures the stability of the vehicle's infotainment system configuration.
[0075] Furthermore, if the configuration file is valid, it will be regenerated according to the configuration level, including: S510. When the configuration file does not exist, the user needs to delete the original configuration file and modify the file with the same name in a different path. S520. After the modifications are complete, restart the vehicle system. When the vehicle system detects that the original configuration file does not exist, it will read the configuration file manually configured by the user.
[0076] In steps S510 and S520, when the vehicle system attempts to regenerate or load the configuration file according to the configuration level, the expected configuration file may not be found in the file system. This can occur due to user error, file corruption, or improper system cleanup.
[0077] Users can manually navigate to the directory where the configuration file is located and perform the deletion operation through the file management interface or diagnostic tools provided by the vehicle system. This can avoid conflicts between the old and new configurations or the system reading the wrong old configuration.
[0078] Considering that the vehicle infotainment system may store configuration files with the same name but different contents in multiple preset paths, such as main configuration, backup configuration, and temporary configuration, after deleting the main configuration file, users need to refer to the system documentation to find and modify or delete all files in known paths storing configuration files with the same name. This prevents the system from accidentally loading older versions of configurations from other paths during subsequent operations, thus ensuring configuration consistency and correctness.
[0079] After the vehicle's infotainment system restarts, it searches for the configuration file according to the preset file path. If the file does not exist, an internal flag is set to indicate that the configuration file is missing. If a critical configuration file is marked as missing or invalid, the corresponding processing procedure is triggered.
[0080] By deleting the original configuration file and modifying files with the same name in different paths, the purity of the configuration environment is ensured, avoiding conflicts between the old and new configurations. Combined with the detection mechanism after a system restart, it can intelligently identify missing configuration files and seamlessly switch to reading manually configured configuration files, thus ensuring the smooth completion of log level modifications and significantly improving the stability and reliability of the vehicle system's log level management.
[0081] Furthermore, the vehicle system adopts a three-level configuration loading strategy: first, it reads the configuration file. If the configuration file exists and passes the verification, it is loaded directly. If the configuration file is damaged or missing, it automatically switches to the safe backup area to read the baseline configuration. When the safe backup area is also damaged, the vehicle system has a built-in default security policy and loads the factory preset configuration through the default security policy.
[0082] When the vehicle infotainment system starts up, it first attempts to retrieve configuration information from the main configuration storage location. After reading the configuration file, the system performs a validity check. If the check passes, it means the configuration file content conforms to the preset format specifications and its integrity has not been compromised. The system then immediately applies the configuration, setting the log level in the corresponding module. When the main configuration file cannot be found or fails the validity check, the system triggers an automatic switching mechanism. The system then boots up the baseline configuration. The baseline configuration is a reliable snapshot of the system under normal operating conditions, ensuring that the system can still operate in a controllable state even if the main configuration is abnormal. In extreme cases, if even the baseline configuration in the secure backup area cannot be accessed or passes the check, the system will load the factory default configuration using the built-in default security policy. This is the most basic and secure configuration preset during production, typically containing minimum functionality and the most conservative settings to ensure the system can at least start and maintain basic operation.
[0083] The three-tier configuration loading strategy ensures that the logging system maintains a usable configuration state under all circumstances, improving the reliability and security of dynamic log level management. Even in extreme scenarios where both user-defined and backup configurations fail, the system can load the factory default configuration through the built-in default security policy, avoiding the risk of complete log system failure, effectively preventing log output chaos, and providing a solid foundation for fault diagnosis and system maintenance.
[0084] [Second Embodiment] See Figure 5 In one specific embodiment, this application also provides a management system for dynamic log levels based on a vehicle infotainment system. The management method described in the above embodiment is applied to the management system 100. The management system 100 includes: a receiving module 110, which is used to receive operation instructions to enter the GEM system; a comparison module 120, which is used to compare the current level and the configuration level; a storage module 130, which is used to store the configuration file; and a judgment module 140, which is used to judge whether the configuration file is valid. This management system has all the technical features of the above management method, which will not be described in detail here.
Claims
1. A method for managing a dynamic log level based on a head unit system, characterized by, The management method includes: The system receives user commands and enters the GEM system. Based on the user's modification commands, it modifies the current level of the configuration file to obtain the modified level. After the vehicle system restarts, it compares the current level of the configuration file with the configuration level in the GEM system. When the current level and the configured level are consistent, the modified level is read through the level management module and configured into other modules; When the current level and the configuration level are inconsistent, the validity of the configuration file is determined by the health detection module; If the configuration file is valid, then the configuration file is regenerated according to the configuration level; If the configuration file is invalid, a rollback mechanism will be triggered immediately.
2. The management method according to claim 1, characterized in that, The process of receiving user operation instructions and entering the GEM system, modifying the current level of the configuration file according to the user's modification instructions, and obtaining the modification level specifically includes: Long press a specific location on the vehicle screen to enter the GEM system. The GEM configuration interface displays the current level of each configuration file, as well as the setting range and modification range of the current level. When the user's modification instruction is within the modification range, the current level is adjusted according to the modification instruction to obtain the modification level; When the user's modification instruction is outside the modification range, the threshold value of the modification range is used as the modification level according to the user's modification intention.
3. The management method according to claim 2, characterized in that, When the current level and the configured level are consistent, the modified level is read through the level management module, and the modified level is configured in other modules, specifically including: The configuration file for executing the modification instruction is recorded as the modification file, and the GEM system inputs the modification level into the modification file; After the vehicle system restarts, the level management module reads the configuration level from the modified file and sets the configuration level to the associated module corresponding to the modified file.
4. The management method according to claim 3, characterized in that, After the vehicle system restarts, the level management module reads the configuration level from the modified file and sets the configuration level to the associated module corresponding to the modified file, specifically including: When the vehicle system restarts, the number of modules that need to be modified by the modification command is counted, and the execution order of the modification command is determined according to the priority of each module; The associated modules are integrated according to the configuration level, and the associated modules are adjusted according to the execution order and the modification level.
5. The management method according to claim 4, characterized in that, The integration of the associated modules according to the configuration level, and the adjustment of the associated modules according to the execution order and the modification level, specifically includes: When the associated module has only one modification level, the associated module is adjusted according to the modification level; When the associated module has multiple modification levels, the associated module does not need to be adjusted and the user is notified of the abnormal command.
6. The management method according to claim 4, characterized by, When the current level and the configuration level are inconsistent, the validity of the configuration file is determined by the health detection module, specifically including: The health monitoring module obtains the log buffer occupancy rate and log output frequency through real-time scanning. The validity of the configuration file is determined based on the log buffer occupancy rate and the log output frequency.
7. The management method according to claim 4, characterized by, If the configuration file is invalid, a rollback mechanism will be triggered immediately, specifically including: Freeze the modified file; Read the most recent valid configuration snapshot from the independent security partition and overwrite the modified files; After the modified file is overwritten, a security audit log is generated, recording the time of the anomaly, the module where the anomaly occurred, and the recovery operation.
8. The management method according to claim 7, characterized in that, If the configuration file is valid, then regenerating the configuration file according to the configuration level also includes: If the configuration file does not exist, the user needs to delete the original configuration file and modify the file with the same name in a different path; After the modifications are complete, restart the vehicle's infotainment system. If the system detects that the original configuration file does not exist, it will read the configuration file that the user manually configured.
9. The management method according to any one of claims 1 to 8, characterized by, The vehicle infotainment system adopts a three-level configuration loading strategy: First, the configuration file is read. If the configuration file exists and the verification passes, it is loaded directly. If the configuration file is damaged or missing, it is automatically switched to the safe backup area to read the baseline configuration. When the security backup area is also damaged, the vehicle system has a built-in default security policy, which loads the factory preset configuration.
10. A management system based on a dynamic log level of a head unit system, characterized by, The management method according to any one of claims 1 to 9 is applied to the management system, the management system comprising: The receiving module is used to receive the operation command into the GEM system; A comparison module is used to compare the current level with the configuration level; A storage module is used to store the configuration file; The judgment module is used to determine whether the configuration file is valid.