A safe real-time shell design method

CN115617397BActive Publication Date: 2026-09-11SHANDONG NEW GENERATION INFORMATION IND TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211299723.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-09-11
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

[0003]现有技术中,在SHELL命令处理器中启动运行的应用程序,默认是以普通低优先级调度模式运行的,无法以实时进程调度模式运行,还需要对机器人节点应用程序进行改造,增加进程调度相关的设计代码,并且必须以root权限运行才能生效

Benefits of technology

[0023]The secure real-time shell design method proposed in this invention is based on the Linux real-time operating system. By modifying the shell for real-time operation, robot node applications can automatically run in real-time process scheduling mode under the shell without modifying the application code to achieve priority promotion, reducing the workload of application porting. At the same time, by modifying the operating system kernel, this function is enabled only for designated IROS users, and the application status is managed through a shell whitelist to ensure system application security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617397B_ABST
    Figure CN115617397B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of robot operating system, in particular to a safe real-time SHELL design method, which comprises the following steps: installing a reconstructed kernel installation package; installing a reconstructed real-time SHELL command processor; editing a white list configuration file by a ROOT administrator, adding robot node application programs, priorities and CPU number information; in a SHELL console, inputting application program commands to run, that is, automatically running in a real-time process scheduling mode; the method has the beneficial effects that the safe real-time SHELL design method based on a Linux real-time operating system is realized by real-time reconstruction of the SHELL, robot node application programs automatically run in a real-time process scheduling mode under the SHELL, priority promotion can be realized without code reconstruction of the application programs, the transplantation workload of the application programs is reduced, the function is enabled only for specified IROS users through reconstruction of an operating system kernel, and the application program state is managed through a SHELL white list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robot operating system technology, specifically to a design method for a secure real-time shell. Background Technology

[0002] Most robots currently use real-time operating systems. In a robot's real-time operating system, the robot node application needs to run in a real-time process scheduling mode in order to meet the system's real-time requirements.

[0003] In the existing technology, applications launched and running in the SHELL command processor run in normal low-priority scheduling mode by default, and cannot run in real-time process scheduling mode. The robot node application needs to be modified to add process scheduling related design code, and it must be run with root privileges to take effect.

[0004] However, it only works when run with root privileges, which will greatly increase the development workload and expose root privileges, creating system security risks. Summary of the Invention

[0005] The purpose of this invention is to provide a secure real-time shell design method to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a secure real-time shell design method, the secure real-time shell design method comprising:

[0007] Install the modified kernel installation package;

[0008] Install the modified real-time SHELL command processor;

[0009] The ROOT administrator edits the whitelist configuration file to add robot node application, priority, and CPU number information.

[0010] In the SHELL console, enter the application command to run it, which will automatically run it in real-time process scheduling mode.

[0011] Preferably, the kernel code of the robot's IROS-RLinux real-time operating system is modified, and the kernel process scheduling code is modified by adding an IROS user scheduling permission verification code module to the process priority system call function code.

[0012] Preferably, a verification code module 1 is added: to verify whether the UID and username of the IROS user are consistent;

[0013] Added verification code module 2: Verifies whether the robot node application belongs to the IROS user;

[0014] Only after successful verification can the robot node application be allowed to execute under the IROS user.

[0015] Preferably, the SHELL command processor includes two functions: setting SHELL whitelist execution parameters and controlling SHELL whitelist execution.

[0016] Preferably, the SHELL whitelist running parameter setting function is set by the ROOT administrator by editing the SHELL whitelist configuration file. The SHELL whitelist permission content includes: robot node application name, real-time priority, and CPU running number parameter information.

[0017] Preferably, the SHELL whitelist operation control function includes: SHELL whitelist loading, IROS robot node application verification, process real-time priority setting, and process CPU affinity setting functions.

[0018] Preferably, the SHELL whitelist loading function reads the SHELL whitelist configuration file and loads it into memory when the SHELL starts.

[0019] Preferably, the IROS robot node application is verified to check whether the user to whom the application belongs is an IROS user and whether the shared library used by the node application is an IROS shared library.

[0020] Preferably, the process real-time priority setting and process CPU affinity setting functions enable SHELL to first create a child process before running the application, set the priority of the child process according to the SHELL whitelist priority parameters, set the CPU affinity of the process, and finally load the application in the child process. The process ID of the application is the child process, which has the set priority and CPU affinity.

[0021] Preferably, for applications not added to the SHELL whitelist, SHELL will assign a real-time priority by default when launching the application, and CPU affinity will be disabled by default, ensuring that all applications launched and running under the real-time SHELL run in real-time priority mode, thus guaranteeing the real-time performance of system programs.

[0022] Compared with the prior art, the beneficial effects of the present invention are:

[0023] The secure real-time shell design method proposed in this invention is based on the Linux real-time operating system. By modifying the shell for real-time operation, robot node applications can automatically run in real-time process scheduling mode under the shell without modifying the application code to achieve priority promotion, reducing the workload of application porting. At the same time, by modifying the operating system kernel, this function is enabled only for designated IROS users, and the application status is managed through a shell whitelist to ensure system application security. Attached Figure Description

[0024] Figure 1 This is a system design architecture diagram of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the present invention clear and complete, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only some, not all, embodiments of the present invention, and are merely illustrative of the embodiments of the present invention. They are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] Example 1

[0027] Please see Figure 1 This invention provides a technical solution: a secure real-time shell design method. This patented method mainly includes two key steps: kernel IROS user real-time priority scheduling control design and shell process priority execution control design. The main solution steps are as follows:

[0028] Kernel IROS User Real-Time Priority Scheduling Control Method -- Implementation Steps:

[0029] i. Modify the kernel code of the robot's IROS-RLinux real-time operating system;

[0030] ii. Modify the kernel process scheduling code by adding an IROS user scheduling permission verification module to the process priority system call function code;

[0031] iii. Add verification code module 1: Verify whether the UID and username of the IROS user are consistent. iv. Add verification code module 2: Verify whether the robot node application belongs to the IROS user.

[0032] v. Only after successful verification can the robot node application be allowed to execute under the IROS user.

[0033] Shell process priority execution control - implementation steps

[0034] i. SHELL whitelist runtime parameter setting function. This function is set by the ROOT administrator by editing the SHELL whitelist configuration file. The SHELL whitelist permissions include parameters such as robot node application name, real-time priority, and CPU running number.

[0035] ii. The SHELL whitelist loading function reads the SHELL whitelist configuration file and loads it into memory when the SHELL starts.

[0036] iii. Verify that the user owning the application is an IROS user, and verify that the shared library used by the node application is an IROS shared library to ensure that it is a robot node application.

[0037] iv. Real-time process priority setting and process CPU affinity setting functions. Before running an application, the SHELL command processor first creates a child process, sets the priority of the child process according to the SHELL whitelist priority parameters, then sets the CPU affinity of the process, and finally loads the application in the child process. The process ID of the application is the child process, which has the set priority and CPU affinity.

[0038] v. For node applications not specified in the SHELL whitelist, SHELL will assign a real-time priority by default when starting the application, and CPU affinity will be disabled by default, ensuring that all applications started and running under the real-time SHELL run at the real-time priority.

[0039] Example 2

[0040] Based on Example 1, in order to realize a patented design method for a secure real-time shell, the patented method includes two key technologies: a kernel IROS user real-time priority scheduling and control method and a shell process priority control method.

[0041] This invention includes a real-time priority scheduling control method for kernel IROS users. By designing and modifying the Linux kernel scheduling code, an IROS user scheduling permission verification function is added to the kernel priority setting code. Only after the verification is passed can the robot node application be allowed to run under the IROS user.

[0042] It has an IROS user scheduling permission verification function, which includes: verifying whether the IROS user's UID and username are consistent, and verifying whether the robot node application belongs to the IROS user.

[0043] This invention includes a shell process priority execution control function. This function comprises two parts: shell whitelist execution parameter setting and shell whitelist execution control.

[0044] This feature includes the ability to set SHELL whitelist operating parameters. This feature is set by the ROOT administrator by editing the SHELL whitelist configuration file. The SHELL whitelist permissions include parameters such as robot node application name, real-time priority, and CPU running number.

[0045] This feature includes SHELL whitelist operation control, which includes: SHELL whitelist loading, IROS robot node application verification, real-time process priority setting, and process CPU affinity setting.

[0046] This feature includes the SHELL whitelist loading function, which reads the SHELL whitelist configuration file and loads it into memory when the SHELL starts.

[0047] This feature includes IROS robot node application verification, which verifies whether the user owning the application is an IROS user and whether the shared library used by the node application is an IROS shared library.

[0048] This feature includes real-time process priority setting and process CPU affinity setting. Before running an application, Shell first creates a child process, sets the priority of this child process according to the Shell whitelist priority parameters, then sets the CPU affinity of this process, and finally loads the application in this child process. The process ID of the application is the child process, which has the set priority and CPU affinity.

[0049] For applications not specified in the SHELL whitelist, SHELL will assign a real-time priority by default when launching the application, and CPU affinity will be disabled by default. This ensures that all applications launched and running under the real-time SHELL run in real-time priority mode, guaranteeing the real-time performance of system programs.

[0050] Example 3

[0051] Building upon Embodiment 2, this invention, applied to the field of robot operating systems, aims to implement a secure real-time shell design method. By modifying the shell for real-time operation and kernel process priority control, a real-time shell command processor is achieved. This processor enables robot IROS users to run robot node applications in real-time priority mode and manages the priority of robot node applications through a shell whitelist, setting the CPU number for program execution to ensure real-time, efficient, and secure system operation. The design method comprises three main processes: first, designing kernel scheduling code to add priority scheduling permission verification control for ordinary IROS users, granting them priority setting permissions while other ordinary users lack this permission; second, the administrator sets shell whitelist parameters, with the shell whitelist configuration file including the robot node application name, priority, and CPU execution number; and third, designing and modifying the shell code to implement functions such as shell whitelist loading, IROS user program verification, real-time priority setting, and CPU affinity setting. First, after the shell starts, it reads the shell whitelist configuration file and loads it into memory. Then, when the user runs the robot node application in the shell command line, the shell first verifies the user who owns the application. If the owner is confirmed to be the IROS user, a child process is created in the shell, and its priority is set according to the shell whitelist priority parameters. Then, the CPU affinity of the child process is set. Finally, the robot node application is loaded and started in this child process. The process ID of this child process is its process ID, and it possesses the set priority and CPU affinity. For applications not added to the shell whitelist, the shell assigns a default real-time priority, and CPU affinity is disabled by default, ensuring that all applications running in the shell operate in real-time priority mode, guaranteeing application real-time performance.

[0052] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A secure real-time shell design method, characterized in that: The design method for the secure real-time shell includes: Install the modified kernel installation package; Install the modified real-time SHELL command processor; The ROOT administrator edits the whitelist configuration file to add robot node application, priority, and CPU number information. In the SHELL console, enter the application command to run it, which will automatically run it in real-time process scheduling mode; The kernel code of the robot's IROS-RLinux real-time operating system was modified, and the kernel process scheduling code was modified. An IROS user scheduling permission verification code module was added to the process priority system call function code. Added verification code module 1: Verify whether the UID and username of the IROS user are consistent; Added verification code module 2: Verifies whether the robot node application belongs to the IROS user; Only after the verification is passed can the robot node application be allowed to execute under the IROS user; The SHELL command processor includes two functions: setting SHELL whitelist execution parameters and controlling SHELL whitelist execution. The SHELL whitelist running parameter setting function is set by the ROOT administrator by editing the SHELL whitelist configuration file. The SHELL whitelist permission content includes: robot node application name, real-time priority, and CPU running number parameter information. The SHELL whitelist operation control function includes: SHELL whitelist loading, IROS robot node application verification, real-time process priority setting, and process CPU affinity setting. The SHELL whitelist loading function reads the SHELL whitelist configuration file and loads it into memory when the SHELL starts up. The IROS robot node application is verified to check whether the user who owns the application is an IROS user and whether the shared library used by the node application is an IROS shared library. The functions of setting real-time process priority and process CPU affinity are implemented by Shell. Before running an application, Shell first creates a child process, sets the priority of the child process according to the priority parameters of the Shell whitelist, sets the CPU affinity of the process, and finally loads the application in the child process. The process ID of the application is the process ID of the child process, which has the set priority and CPU affinity. Applications not specified in the SHELL whitelist will be assigned a real-time priority by default when the SHELL starts the application, and CPU affinity will be disabled by default. This ensures that all applications launched and running under the real-time SHELL run in real-time priority mode, guaranteeing the real-time performance of system programs.

Citation Information

Patent Citations

  • Kernel authority management system and method of mobile terminal

    CN105701415A

  • Right management method and device

    CN106169042A