Personalized setting optimization method for credential operation system
By monitoring and analyzing the performance data and kernel parameters of the Xinchuang operating system in real time, adjusting the kernel parameters and cropping the kernel modules, the problem of delayed response speed of the Xinchuang operating system is solved, and the system performance is significantly improved and stability enhancement is enhanced.
Patent Information
- Application Number
- CN202411932595.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-13
AI Technical Summary
The response speed of the Xinchuang operating system is relatively lagging in some application scenarios, mainly due to the inadequate maturity and optimization of kernel functions.
By using performance monitoring tools to collect system performance data and kernel parameters in real time, perform visual analysis, and formulate optimization plans, including adjusting kernel parameters and cropping kernel modules to improve system response speed.
It significantly improves the response speed and overall performance of the Xinchuang operating system, enhances the reliability and stability of the system, and simplifies subsequent system maintenance and upgrade work.
Smart Images

Figure CN119988159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of trusted computing operating systems, and in particular to a method for optimizing personalized settings of trusted computing operating systems. Background Art
[0002] The trusted operating system, also known as an autonomous and controllable operating system, is an important part of China's information security and autonomous control.
[0003] The research and development of the trusted operating system involves multiple technical fields such as the operating system kernel, drivers, middleware, and security mechanisms. The operating system kernel is designed and optimized based on the domestic CPU architecture to give full play to the hardware performance. Enhance the security and reliability of the kernel, such as introducing hardware-assisted security mechanisms and fault tolerance. The driver develops independent and controllable drivers for domestic CPUs and hardware platforms to ensure the controllability of the entire software and hardware stack. Through the security reinforcement of the driver, the system's anti-virus and anti-attack capabilities are improved. The middleware components need to be deeply integrated with the operating system kernel to ensure overall security and performance. The middleware needs to provide a rich API interface to facilitate the development and porting of applications. The secure and reliable system architecture introduces security mechanisms at various levels such as the operating system kernel, drivers, and middleware to form a deep defense.
[0004] However, as an emerging operating system, the kernel functions of the Xinchuang operating system are not mature and optimized enough in actual application. Some key kernel functions, such as process management, file system, network protocol stack, etc., need to be further improved in terms of performance optimization and response speed. This may cause the response speed of the Xinchuang operating system to lag slightly in some application scenarios. Summary of the invention
[0005] Based on the above purpose, the present invention provides a personalized setting optimization method for a trusted operating system, which is used to improve the response speed of a trusted operating system developed based on a Linux system, comprising:
[0006] S1. Use performance monitoring tools to collect performance data of the trusted operating system and monitor the kernel parameters of the trusted operating system in real time.
[0007] S2. Develop an optimization plan for the trusted operating system based on performance data and kernel parameters, including:
[0008] S21. Optimize the Xinchuang operating system by adjusting kernel parameters, including:
[0009] S211. Perform visual analysis on the performance data and generate optimization data.
[0010] S212. Dynamically adjust corresponding kernel parameters according to the optimization data, and make the optimized kernel parameter configuration persistent.
[0011] S22. Optimize the Xinchuang operating system by cutting kernel modules, including:
[0012] S221. Analyze kernel module dependencies.
[0013] S222. Trim the kernel module.
[0014] S3. Use performance evaluation tools to conduct a comprehensive assessment of the trusted computing operating system.
[0015] By collecting the system's performance data and kernel parameters in real time and visually analyzing the performance data, the system's performance bottlenecks can be more intuitively found. By properly adjusting the kernel parameters, the system's response speed can be greatly improved. By analyzing the kernel module dependencies and cutting out unnecessary kernel function modules, the kernel size can be reduced and the overall performance can be improved. Comprehensively test the optimized system performance to verify whether the optimization effect meets the standards, providing an important basis for subsequent optimization adjustments.
[0016] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S1, the performance data includes performance indicator data of the trusted operating system kernel subsystem and tracking data of the kernel execution path and timing characteristics, and the perfrecord command is used to collect the performance indicator data, the performance indicator data includes memory usage data, CPU usage rate and interrupt processing data, and the performance indicator data is saved as a perf.data file. The function_profile function of the ftrace tool is used to track the kernel execution path and timing characteristics to obtain the tracking data, and the tracking data is saved as a text log.
[0017] According to a personalized setting optimization method for a trusted computing operating system provided by the present invention, in step S1, the sysfs interface is used to collect kernel parameters during system operation, and the kernel parameters include memory management, CPU scheduling and network stack.
[0018] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S211, the process of visually analyzing performance data includes: using the perfreport command to analyze the perf.data file to display the indicator performance problems of the kernel subsystem. Use the trace-cmd tool to open the text log, and use the kernelshark tool to analyze the text log to obtain the tracking performance problems.
[0019] According to a personalized setting optimization method for a trusted computing operating system provided by the present invention, in step S211, the method of generating optimization data includes: locating indicator performance problems through kernel source code and tracking the code locations where performance problems are generated, and generating optimization data, and the optimization data includes memory allocation optimization and scheduling strategy improvement.
[0020] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S212, the process of dynamically adjusting corresponding kernel parameters includes:
[0021] Identify the kernel subsystem where the optimization data is located, and obtain the adjustable parameters corresponding to the kernel subsystem.
[0022] Use the sysctl command to dynamically adjust the adjustable parameters and obtain N parameter combinations.
[0023] Collect the adjusted performance data of the kernel of the trusted computing operating system, compare the adjusted performance data with the performance indicator data, quantify the comparison results, and obtain performance improvement data.
[0024] Perform A / B tests on N parameter combinations, and use the parameter combination that achieves the preset performance improvement data as the kernel parameter configuration.
[0025] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S212, the process of persisting the optimized kernel parameter configuration includes: adding an independent kernel optimization configuration file to the sysctl.conf file, and writing the kernel parameter configuration into the kernel optimization configuration file. Continuously monitor and analyze the performance data of the trusted operating system, and if new indicator performance problems or tracking performance problems are found, adjust the kernel parameters again.
[0026] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S221, the process of analyzing kernel module dependencies includes:
[0027] Use the modinfo command to view detailed information about each module in the Xinchuang operating system kernel.
[0028] Analyze the build dependencies between modules by combining detailed information with the Kconfig and Makefile files in the internal source code.
[0029] Based on the build dependencies, use the graphviz tool to generate a visual kernel module dependency.
[0030] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S222, the process of tailoring the kernel module includes:
[0031] Check the startup log and dmesg output of the Xinchuang operating system to identify kernel modules that are not loaded during the operation of the Xinchuang operating system as trimming modules.
[0032] Find the tailoring module in the kernel configuration tool, obtain the dependency relationship between the tailoring module and other modules, and directly remove the tailoring module whose dependency is lower than a preset dependency threshold.
[0033] Set the trimmed modules whose dependencies are above the preset dependency threshold to be dynamically loadable and completely removed at the next kernel build.
[0034] According to a personalized setting optimization method for a trusted operating system provided by the present invention, in step S3, the process of comprehensively evaluating the trusted operating system includes:
[0035] S31. Use performance evaluation tools to perform performance tests on the trusted computing operating system before optimization to obtain original performance data.
[0036] S32. Use performance evaluation tools to perform performance tests on the optimized trusted computing operating system to obtain optimized performance data.
[0037] S33. Compare and analyze the original performance data with the optimized performance data, and quantify the degree of improvement of the performance indicator data.
[0038] S34. Determine whether the optimization measures are effective based on the degree of improvement, otherwise adjust the optimization plan.
[0039] Beneficial effects of the present invention:
[0040] The present invention collects the performance data and kernel parameters of the system in real time through a performance monitoring tool, providing a basis for subsequent optimization. Through visual analysis of these performance data, the performance bottleneck of the system can be more intuitively found. Kernel parameters are one of the key factors that determine system performance. Reasonable adjustment of these parameters can greatly improve the response speed of the system. Persistent storage of the optimized kernel parameters can ensure the long-term stability of the optimization effect. By analyzing the kernel module dependency and cutting out unnecessary kernel function modules, the kernel volume can also be reduced and the overall performance can be improved. This module cutting method can avoid excessive impact on system functions. Use a comprehensive performance evaluation tool to comprehensively test the performance of the optimized system to verify whether the optimization effect meets the standard. Through quantitative performance data comparison and analysis, an important basis is provided for subsequent optimization and adjustment.
[0041] This optimization solution conducts a comprehensive analysis and optimization of the performance bottlenecks of the trusted operating system, covering multiple aspects such as kernel parameter tuning, kernel module tailoring, and comprehensive performance evaluation. It not only greatly improves the system's response speed and overall performance, but also enhances the system's reliability and stability, and simplifies subsequent system maintenance and upgrades. The comprehensive and in-depth optimization solution provides an effective optimization idea for trusted operating systems developed based on Linux systems, which helps promote the sustainable and healthy development of the trusted industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flowchart of a personalized setting optimization method for a trusted computing operating system provided by an embodiment of the present invention;
[0044] Figure 2 It is a flow chart of optimizing a trusted operating system by adjusting kernel parameters in a trusted operating system personalized setting optimization method provided by an embodiment of the present invention;
[0045] Figure 3 It is a flow chart of optimizing a trusted operating system by cutting a kernel module in a trusted operating system personalized setting optimization method provided by an embodiment of the present invention;
[0046] Figure 4 It is a flowchart of comprehensively evaluating a trusted operating system in a trusted operating system personalized setting optimization method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. At the same time, it is explained here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments, and those skilled in the art may also adopt other alternatives to implement some known technologies; and the accompanying drawings are only for more specific description of the embodiments, and are not intended to specifically limit the present invention.
[0048] like Figure 1 As shown, an embodiment of the present invention provides a personalized setting optimization method for a trusted operating system, comprising the following steps:
[0049] S1. Use performance monitoring tools to collect performance data of the trusted operating system and monitor the kernel parameters of the trusted operating system in real time.
[0050] The performance data includes the performance indicator data of the kernel subsystem of the Xinchuang operating system and the tracking data of the kernel execution path and timing characteristics. The perfrecord command is used to collect the performance indicator data. The performance indicator data includes memory usage data, CPU usage rate and interrupt processing data, and the performance indicator data is saved as a perf.data file. The function_profile function of the ftrace tool is used to track the kernel execution path and timing characteristics, obtain the tracking data, and save the tracking data as a text log.
[0051] Use the sysfs interface to collect kernel parameters during system runtime. Kernel parameters include memory management, CPU scheduling, and network stack.
[0052] In this embodiment, collecting performance indicator data may also include using the perfrecord-eblock:block_rq_issue command to collect disk I / O related indicators, using the perfrecord-enet:net_dev_xmit and net:net_dev_receive commands to collect network packet data, and using the perfrecord-esyscalls:sys_enter_ and syscalls:sys_exit_ commands to collect system call related indicators.
[0053] The acquisition of tracing data may also include using the ftracefunction_graph_entry / exit command to record the calling relationship and execution time of the kernel function, using the ftraceirq_handler_entry / exit command to record the interrupt handling process, and using the ftraceworkqueue_execute_start / end command to record the execution of the work queue task.
[0054] Kernel parameters can also include obtaining parameters of file systems such as ext4 and btrfs through the sysfs interface, such as file system cache hit rate, read and write latency, etc. Obtain parameters of CFS scheduler and real-time scheduler through the sysfs interface, such as load balancing, priority, etc. Obtain parameters of kernel security mechanisms such as SELinux and Apparmor through the sysfs interface, such as policies and permissions.
[0055] S2. Develop an optimization plan for the trusted operating system based on performance data and kernel parameters, including:
[0056] S21. Optimize the trusted computing operating system by adjusting kernel parameters.
[0057] like Figure 2As shown in the figure, the process of adjusting kernel parameters to optimize the Xinchuang operating system includes:
[0058] S211. Perform visual analysis on the performance data and generate optimization data.
[0059] The process of visually analyzing performance data includes: using the perfreport command to analyze the perf.data file to display the performance issues of the kernel subsystem. Using the trace-cmd tool to open the text log, and using the kernelshark tool to analyze the text log to obtain trace performance issues.
[0060] In this embodiment, the perf.data file is parsed into a visual performance report by running the perfreport command. The report will show the performance indicators of each kernel subsystem (memory management, CPU scheduling, file system, etc.), such as CPU utilization, interrupt processing time, etc. In this way, the kernel subsystem with performance indicator problems is identified, providing a basis for the next step of optimization. Use the trace-cmd tool to open the kernel execution trace text log. Use the kernelshark visualization tool to analyze the trace data and view the call relationship, execution time, etc. of the kernel function. In this way, the key function call points with problems in the kernel execution path and timing characteristics are identified, providing a key direction for optimization.
[0061] The methods of generating optimization data include: locating indicator performance problems through kernel source code and tracking the code locations where performance problems are generated, generating optimization data, and the optimization data includes memory allocation optimization and scheduling strategy improvement.
[0062] In this embodiment, the results of perfreport and kernelshark analysis are combined to locate the kernel source code where the performance problem occurs. The relevant kernel code is deeply analyzed to understand the root cause of the performance problem, such as improper memory allocation, suboptimal scheduling strategy, etc.
[0063] For the problem of improper memory allocation, analyze the memory usage pattern and make optimization suggestions, such as adjusting the memory allocation algorithm, improving the memory layout, etc. For the problem of suboptimal scheduling strategy, analyze the CPU load characteristics and make optimization suggestions, such as adjusting the scheduler parameters, optimizing the load balancing algorithm, etc. The above optimization suggestions are transformed into specific optimization data.
[0064] S212. Dynamically adjust corresponding kernel parameters according to the optimization data, and make the optimized kernel parameter configuration persistent.
[0065] The process of dynamically adjusting the corresponding kernel parameters includes:
[0066] Identify the kernel subsystem where the optimization data is located, and obtain the adjustable parameters corresponding to the kernel subsystem.
[0067] Use the sysctl command to dynamically adjust the adjustable parameters and obtain N parameter combinations.
[0068] Collect the adjusted performance data of the kernel of the trusted computing operating system, compare the adjusted performance data with the performance indicator data, quantify the comparison results, and obtain performance improvement data.
[0069] Perform A / B tests on N parameter combinations, and use the parameter combination that achieves the preset performance improvement data as the kernel parameter configuration.
[0070] In this embodiment, according to the optimization data, analyze which kernel subsystems are targeted, such as memory management, CPU scheduling, network stack, etc. Consult the adjustable parameter documents corresponding to the kernel subsystem to understand which kernel parameters can be optimized. For example, for memory management optimization, parameters such as vm.swappiness and vm.dirty_ratio can be adjusted.
[0071] Use the sysctl command to dynamically modify the value of kernel parameters, which will take effect without restarting the system. According to the optimization data, try different parameter combinations and record each parameter combination.
[0072] Under each parameter combination, re-collect the performance indicator data of the Xinchuang operating system, such as CPU usage, memory usage, etc. Compare the adjusted performance data with the previous benchmark performance data, and use statistical analysis methods such as T-test and variance analysis to calculate the performance improvement and quantify the significance of the performance improvement.
[0073] Set a performance improvement target threshold. Only parameter combinations that meet the target threshold will be selected. The final selected kernel parameter configuration will be saved as the optimized configuration of the trusted computing operating system.
[0074] The process of persisting the optimized kernel parameter configuration includes: adding an independent kernel optimization configuration file to the sysctl.conf file, writing the kernel parameter configuration to the kernel optimization configuration file, and continuously monitoring and analyzing the performance data of the Xinchuang operating system. If new indicator performance problems or tracking performance problems are found, the kernel parameters are adjusted again.
[0075] In this embodiment, sysctl.conf is the main configuration file of the Linux kernel, and the parameter settings therein are automatically loaded and applied when the system starts. Adding an independent kernel optimization configuration file in the sysctl.conf file can separate the kernel optimization parameters from other system parameters, which is convenient for subsequent management and maintenance.
[0076] Repeat the performance data collection and visualization analysis process regularly to check whether new performance issues have occurred. For newly discovered performance issues, repeat the process of dynamic kernel parameter adjustment and A / B testing. If a new optimal kernel parameter configuration is determined through A / B testing, the kernel optimization configuration file needs to be updated. Modify the value of the corresponding parameter in the configuration file, or add a new parameter configuration. Ensure that all kernel optimization parameters are recorded in the kernel optimization configuration file.
[0077] S22. Optimize the trusted computing operating system by trimming kernel modules.
[0078] like Figure 3 As shown in the figure, the process of optimizing the Xinchuang operating system by cutting out the kernel module includes:
[0079] S221. Analyze kernel module dependencies.
[0080] The process of analyzing kernel module dependencies includes:
[0081] Use the modinfo command to view detailed information about each module in the Xinchuang operating system kernel.
[0082] Analyze the build dependencies between modules by combining detailed information with the Kconfig and Makefile files in the internal source code.
[0083] Based on the build dependencies, use the graphviz tool to generate a visual kernel module dependency.
[0084] In this embodiment, the modinfo command can view detailed information of a specified kernel module, including dependencies, parameters, etc. For example, modinfoext4 can view module information of the ext4 file system. From the module information, other kernel modules that it depends on can be obtained.
[0085] The Kconfig file describes the configuration options and dependencies of the module. The Makefile file describes the compilation and build order and dependencies of the module. By analyzing these two types of files, you can fully understand the dependencies between various kernel modules.
[0086] Write a script to generate a Graphviz input file (such as .dot format) based on the module information obtained by the modinfo command and the dependencies in the kernel source code. Then use the Graphviz command line tool dot to render the .dot file into an image file, such as .png or .svg. The generated visualization can more intuitively show the dependencies between various kernel modules.
[0087] S222. Trim the kernel module.
[0088] The process of tailoring the kernel module includes:
[0089] Check the startup log and dmesg output of the Xinchuang operating system to identify kernel modules that are not loaded during the operation of the Xinchuang operating system as trimming modules.
[0090] Find the tailoring module in the kernel configuration tool, obtain the dependency relationship between the tailoring module and other modules, and directly remove the tailoring module whose dependency is lower than a preset dependency threshold.
[0091] Set the trimmed modules whose dependencies are above the preset dependency threshold to be dynamically loadable and completely removed at the next kernel build.
[0092] In this embodiment, by checking the system startup log and the output of the dmesg command, it is possible to find kernel modules that are not loaded during the system operation. These unloaded modules are candidate modules that can be trimmed. The names of these unloaded modules are recorded as the targets of trimming.
[0093] Open the kernel configuration tool of the Xinchuang operating system (such as makemenuconfig) and find the trimming module recorded in the previous step. Check the dependency between the trimming module and other modules in the kernel's Kconfig and Makefile files to understand the degree of association between them.
[0094] For the trimmed modules whose dependency is lower than the preset threshold, they can be directly removed from the kernel configuration. The preset dependency threshold can be adjusted according to the actual situation, such as setting it to 2 or 3. This can minimize the impact of the trimmed modules on the system function.
[0095] For tailored modules with dependencies higher than the preset threshold, they cannot be directly removed, otherwise it may cause system functions to be lost. Set these modules to be dynamically loadable, that is, load them only when needed, rather than by default. In the next kernel build, these high-dependency modules will be completely removed from the kernel configuration, leaving only the dynamically loaded interface.
[0096] After completing the trimming configuration of the kernel module according to the above steps, rebuild the kernel image. Test the trimmed kernel in the actual operating environment to ensure that the system functions and performance are not affected. If problems are found, you can restore the previous kernel configuration and re-analyze the trimming solution.
[0097] S3. Use performance evaluation tools to conduct a comprehensive assessment of the trusted computing operating system.
[0098] like Figure 4 As shown in the figure, the process of conducting a comprehensive assessment of the Xinchuang operating system includes:
[0099] S31. Use performance evaluation tools to perform performance tests on the trusted computing operating system before optimization to obtain original performance data.
[0100] S32. Use performance evaluation tools to perform performance tests on the optimized trusted computing operating system to obtain optimized performance data.
[0101] S33. Compare and analyze the original performance data with the optimized performance data, and quantify the degree of improvement of the performance indicator data.
[0102] S34. Determine whether the optimization measures are effective based on the degree of improvement, otherwise adjust the optimization plan.
[0103] In this embodiment, a performance evaluation tool is installed on the Xinchuang operating system through a package manager to start a comprehensive benchmark test of the system. The performance evaluation tool may include SysBench, SPECCPU, Bonnie++, etc.
[0104] According to the kernel optimization plan, the Xinchuang operating system is optimized accordingly, including kernel parameter tuning, kernel module trimming and other optimization measures.
[0105] The same test cases are run on the optimized Xinchuang operating system for comprehensive testing. The result of this test is the optimized performance data, and these original performance data are recorded as optimized performance data.
[0106] Compare and analyze the original performance data and the optimized performance data one by one. Calculate the improvement of each performance indicator, such as percentage improvement or absolute value improvement.
[0107] According to the comparison results, the improvement degree of each performance indicator is quantified by calculating the weighted average improvement degree of the overall performance.
[0108] Based on the quantified performance improvement, determine whether the current optimization measures have achieved the expected results. If the improvement of some indicators is not ideal, the optimization plan needs to be adjusted. For indicators with insufficient performance improvement, re-examine the previous optimization measures. Try other optimization methods and repeat the above test and analysis process until all performance indicators have achieved a satisfactory improvement.
[0109] In summary, this embodiment provides a personalized setting optimization method for a trusted operating system, which collects the performance data and kernel parameters of the system in real time through a performance monitoring tool to provide a basis for subsequent optimization. By visually analyzing these performance data, the performance bottleneck of the system can be more intuitively found. Kernel parameters are one of the key factors that determine system performance. Reasonable adjustment of these parameters can greatly improve the response speed of the system. Persistent preservation of the optimized kernel parameters can ensure the long-term stability of the optimization effect. By analyzing the kernel module dependencies and cutting out unnecessary kernel function modules, the kernel volume can also be reduced and the overall performance can be improved. This module cutting method can avoid excessive impact on system functions. Use a comprehensive performance evaluation tool to comprehensively test the optimized system performance and verify whether the optimization effect is up to standard. Through quantitative performance data comparison and analysis, an important basis is provided for subsequent optimization and adjustment. In general, this optimization scheme conducts a comprehensive analysis and optimization of the performance bottleneck of the trusted operating system, covering multiple levels such as kernel parameter tuning, kernel module cutting, and comprehensive performance evaluation. Not only does it greatly improve the response speed and overall performance of the system, it also enhances the reliability and stability of the system, and simplifies subsequent system maintenance and upgrade work. The comprehensive and in-depth optimization solution provides an effective optimization idea for the trusted computing operating system developed based on the Linux system, which helps promote the sustained and healthy development of the trusted computing industry.
[0110] Based on the same general inventive concept, the present invention also protects a personalized setting optimization system for a trusted operating system. The personalized setting optimization system for a trusted operating system provided by the present invention is described below. The personalized setting optimization system for a trusted operating system described below and the personalized setting optimization method for a trusted operating system described above can refer to each other.
[0111] The personalized settings optimization system of the Xinchuang operating system includes a performance monitoring and data analysis module, a system optimization module and a performance evaluation module.
[0112] The performance monitoring and data analysis module is used to collect the performance data of the operating system and perform visual analysis on the data to provide a basis for subsequent optimization.
[0113] The system optimization module optimizes the operating system by adjusting kernel parameters and cutting kernel modules according to the performance analysis results. Kernel parameter tuning can dynamically optimize system performance, and kernel module cutting can reduce system size and improve response speed.
[0114] The performance evaluation module uses a standard benchmark suite to comprehensively evaluate the optimized operating system and verify the optimization effect.
[0115] The performance monitoring and data analysis module includes a performance data collection unit, a kernel parameter monitoring unit and a performance data visualization unit.
[0116] The performance data collection unit uses performance monitoring tools (such as perf, eBPF, etc.) to collect performance data of the operating system in real time, including indicators such as CPU utilization, memory usage, and I / O throughput.
[0117] The kernel parameter monitoring unit monitors the key parameters of the operating system kernel in real time, such as scheduling strategy, caching mechanism, network protocol, etc.
[0118] The performance data visualization unit visualizes and analyzes the collected performance data and generates optimization suggestions.
[0119] The system optimization module includes a kernel parameter tuning unit and a kernel module trimming unit.
[0120] The kernel parameter tuning unit dynamically adjusts kernel parameters according to the performance analysis results, such as increasing file cache, optimizing network protocol stack, etc., and makes the optimized configuration persistent.
[0121] The kernel module trimming unit is used to analyze the dependencies of kernel modules, remove unnecessary kernel modules, reduce kernel size and improve response speed.
[0122] In this embodiment, the key performance indicators of the operating system, such as CPU, memory, I / O, etc., are collected and visualized and analyzed in real time through the performance monitoring and data analysis module, and the kernel parameters are monitored. Based on these performance data, the system optimization module can adjust the kernel parameters and cut the kernel modules in a targeted manner, and perform targeted optimization, thereby effectively improving the response speed and performance of the entire system. Compared with a one-size-fits-all optimization method, this optimization method based on actual performance data can be more accurate and efficient.
[0123] The modular design is adopted, and the functions of each module are clear and the coupling degree is low. This is not only conducive to the maintenance and upgrade of the system, but also enables the optimization solution to flexibly adapt to the needs of different hardware platforms and application scenarios. For example, the performance monitoring and data analysis module can use different monitoring tools according to different hardware characteristics, and the system optimization module can also implement different optimization strategies for different performance bottlenecks. This flexibility enables the optimization solution to better adapt to the diverse needs of the trusted operating system.
[0124] Through continuous performance monitoring and optimization, we can identify and solve performance problems in the system and improve system reliability and stability. For example, kernel parameter tuning can dynamically optimize system performance and avoid performance bottlenecks caused by fixed configurations; kernel module trimming can reduce kernel size, reduce system complexity, and improve overall stability. At the same time, the performance evaluation module can fully verify the optimization effect and ensure the effectiveness of the optimization solution.
[0125] Modular design and automated optimization mechanisms can significantly reduce the maintenance burden on system administrators. Performance monitoring and optimization processes are automated, and administrators do not need to frequently adjust parameters and configurations; modular design also makes system upgrades and problem location simpler and more efficient. This reduces the manpower and time costs of system maintenance and improves overall operation and maintenance efficiency.
[0126] The present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention. In order to make the public have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention, but those skilled in the art can fully understand the present invention without the description of these details. In addition, in order to avoid unnecessary confusion about the essence of the present invention, well-known methods, processes, procedures, components and circuits are not described in detail.
[0127] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A personalized setting optimization method for a trusted operating system, used to improve the response speed of a trusted operating system developed based on a Linux system, characterized in that: include: S1. Use a performance monitoring tool to collect performance data of the trusted operating system and monitor the kernel parameters of the trusted operating system in real time; S2. Formulate an optimization plan for the trusted operating system based on the performance data and kernel parameters, including: S21. Optimizing the trusted operating system by adjusting kernel parameters, including: S211, performing visual analysis on the performance data and generating optimization data; S212, dynamically adjusting corresponding kernel parameters according to the optimization data, and making the optimized kernel parameter configuration persistent; S22, optimizing the trusted operating system by cutting kernel modules, including: S221, analyzing kernel module dependencies; S222, trimming the kernel module; S3. Use performance evaluation tools to conduct a comprehensive evaluation of the trusted computing operating system.
2. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S1, the performance data includes performance indicator data of the kernel subsystem of the Xinchuang operating system and tracking data of the kernel execution path and timing characteristics, and the performance indicator data is collected using the perfrecord command. The performance indicator data includes memory usage data, CPU usage rate and interrupt processing data, and the performance indicator data is saved as a perf.data file; The function_profile function of the ftrace tool is used to track the kernel execution path and timing characteristics, obtain tracing data, and save the tracing data as a text log.
3. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S1, the kernel parameters of the system during operation are collected using the sysfs interface, wherein the kernel parameters include memory management, CPU scheduling, and network stack.
4. According to claim 2, a personalized setting optimization method for a trusted operating system is characterized in that: In step S211, the process of visually analyzing the performance data includes: using the perfreport command to analyze the perf.data file to display the indicator performance problems of the kernel subsystem; using the trace-cmd tool to open the text log, and using the kernelshark tool to analyze the text log to obtain tracking performance problems.
5. According to claim 4, a personalized setting optimization method for a trusted operating system is characterized in that: In step S211, the method of generating the optimization data includes: locating the code position where the indicator performance problem and the tracking performance problem are generated through kernel source code, and generating optimization data, wherein the optimization data includes memory allocation optimization and scheduling strategy improvement.
6. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S212, the process of dynamically adjusting the corresponding kernel parameters includes: Identify the kernel subsystem where the optimization data is located, and obtain adjustable parameters corresponding to the kernel subsystem; Dynamically adjust the adjustable parameters using the sysctl command to obtain N parameter combinations; Collect the adjusted performance data of the kernel of the Xinchuang operating system, compare the adjusted performance data with the performance indicator data, and quantify the comparison results to obtain performance improvement data; An A / B test is performed on the N parameter combinations, and a parameter combination that achieves preset performance improvement data is used as the kernel parameter configuration.
7. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S212, the process of making the optimized kernel parameter configuration persistent includes: adding an independent kernel optimization configuration file in the sysctl.conf file, and writing the kernel parameter configuration into the kernel optimization configuration file; continuously monitoring and analyzing the performance data of the trusted operating system, and adjusting the kernel parameters again if new indicator performance problems or tracking performance problems are found.
8. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S221, the process of analyzing the kernel module dependency includes: Use the modinfo command to view detailed information of each module in the kernel of the Xinchuang operating system; Analyze the build dependencies between modules by combining the detailed information with the Kconfig and Makefile files in the internal source code; According to the above-mentioned construction dependencies, the graphviz tool is used to generate a visual kernel module dependency.
9. According to claim 6, a personalized setting optimization method for a trusted operating system is characterized in that: In step S222, the process of trimming the kernel module includes: Check the startup log and dmesg output of the trusted operating system, and identify kernel modules that are not loaded during the operation of the trusted operating system as trimming modules; Find the tailoring module in the kernel configuration tool, obtain the dependency relationship between the tailoring module and other modules, and directly remove the tailoring modules whose dependency is lower than a preset dependency threshold; The tailored modules whose dependencies are higher than the preset dependency threshold are set to be dynamically loadable and completely deleted during the next kernel build.
10. According to claim 1, a personalized setting optimization method for a trusted operating system is characterized in that: In step S3, the process of comprehensively evaluating the trusted operating system includes: S31. Use a performance evaluation tool to perform a performance test on the Xinchuang operating system before optimization to obtain original performance data; S32. Use a performance evaluation tool to perform performance testing on the optimized Xinchuang operating system to obtain optimized performance data; S33, comparing and analyzing the original performance data with the optimized performance data, and quantifying the degree of improvement of the performance indicator data; S34. According to the improvement degree, determine whether the optimization measures are effective, otherwise adjust the optimization plan.