VR training implementation method based on Kylin system

By rewriting the OpenVR-related call interface and installing drivers on the domestic Kirin V10 operating system, the problem of HTC Vive Pro2 VR devices being unable to adapt is solved, the adaptation and use of VR devices is realized, and the development costs are reduced, while increasing the cost of development is increased. System security.

CN119473330APending Publication Date: 2025-02-18CHINESE PEOPLES LIBERATION ARMY UNIT 32181
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411634182.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing technology cannot enable HTC Vive Pro2 VR devices to be adapted to and used on the domestic Kirin V10 operating system, and virtual simulation applications cannot operate normally under the domestic Kirin operating system.

Method used

By building a Rust language development environment, using the open function to open the /dev/led driver, and operate the underlying driver; initialize the VIVE HID-related settings, configure the VR device mode, and obtain device data; rewrite the OpenVR-related call interface in the Linux system to define the device Display components, build Docker images through docker build, output drivers, and finally install drivers under the Linux system kernel.

Benefits of technology

The adaptation and use of HTC Vive Pro2 VR equipment on the domestically produced Kirin V10 operating system has been realized, reducing the adaptation cost of developing other VR equipment and improving the security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473330A_ABST
    Figure CN119473330A_ABST
Patent Text Reader

Abstract

The invention discloses a VR training implementation method based on a Kylin system. The VR training implementation method is specifically implemented according to the following steps: step 1, establishing a Rust language development environment; step 2, opening / dev / led drive by using an open function, and operating a bottom layer drive; step 3, initializing related settings of the VIVE HID; 4, acquiring equipment data; step 5, rewriting an OpenVR related calling interface; 6, defining an equipment display component; step 7, constructing a Docker mirror image, and outputting a driving program; and step 8, installing a drive program in the kernel of the Linux system to realize the use of the VR equipment in the Kylin V10 operating system. According to the VR training implementation method based on the Kylin system, HTC Vive Pro2 VR equipment can be adapted to a domestic Kylin V10 operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of virtual simulation technology, and specifically relates to a method for implementing VR training based on the Galaxy Kylin system. Background Art

[0002] At present, the mainstream VR device is HTC Vive Pro, which is mainly developed based on Windows operating system. It can be adapted to Windows 10 and above operating systems. With the development and application of domestic operating systems, more and more users are beginning to pay attention to the compatibility of virtual reality technology and virtual reality devices under domestic operating systems.

[0003] As a mainstream domestic operating system, the Galaxy Kirin V10 operating system has always been favored by technicians and enthusiasts. At present, the compatibility of HTC Vive Pro under the domestic operating system is quite good. Many domestic users have successfully paired HTC Vive Pro with their Linux system and enjoyed an immersive virtual reality experience. However, HTC does not provide Vive Pro 2 drivers for non-Windows users. The current driver implementation intercepts some calls between the common headset driver "driver_lighthouse" used by SteamVR and OG Vive, and makes it compatible with the newer Vive Pro 2. At present, virtual simulation applications developed based on the Unity3d virtual simulation engine can adapt to the Windows operating system, and it is not technically possible to publish virtual simulation applications as virtual simulation application software that can run normally under the domestic Kirin operating system V10. Summary of the invention

[0004] The purpose of the present invention is to provide a VR training implementation method based on the Galaxy Kirin system, so that the HTC Vive Pro2 VR device can adapt to the domestically produced Kirin V10 operating system.

[0005] The technical solution adopted by the present invention is a method for implementing VR training based on the Galaxy Kylin system, which is specifically implemented in the following steps: Step 1: Build the Rust language development environment; Step 2, use the open function to open the / dev / led driver and operate the underlying driver; Step 3, initialize VIVE HID related settings; Step 4: Configure the VR device mode and obtain device data; Step 5, rewrite the OpenVR related calling interface in the Linux system; Step 6, define the device display component; Step 7: Use the docker build command to build a Docker image and output the driver program. Step 8: Install the driver under the Linux system kernel to enable the use of VR devices in the Kylin V10 operating system.

[0006] The technical solution of the present invention is also characterized in that: Step 2 is as follows: S1, load a driver module, generate a device file and the corresponding inode structure; S2, the application layer calls the open function to open the device file. When the upper layer calls open to the kernel, a soft interrupt occurs and enters the kernel space from the user space. S3, open calls the sys_open function. The sys_open function finds the information described by the struct inode structure corresponding to the device file according to the address of the file, obtains the type of the operating device, character device or block device, and allocates a struct file structure; S3, according to the major device number and minor device number recorded in the struct inode structure, obtain the struct cdev structure in the character device driver; S4, the Linux kernel records the first address of the memory space where the struct cdev structure is located in the i_cdev member of the structinode structure, and records the function operation interface address recorded in the struct cdev structure in the f_ops member of the struct file structure; S5, execute xxx_open driver function.

[0007] Loading driver module is as follows: Compile the driver into a module and use the command to load the driver module after the Linux kernel is started; after the driver is compiled, the extension is .ko.

[0008] The commands include insmod and modprobe. modprobe analyzes the dependencies of the driver modules and loads all dependent modules into the Linux kernel.

[0009] Step 3 is as follows: configure the VR device mode, make relevant settings for opening the device for the first time, read the device serial number related information, configure Steam and save the settings, define the SteamConfig structure, and define relevant parameters. The specific steps of obtaining device data in step 4 are as follows: obtaining relevant device information through an API.

[0010] Step 6 is as follows: Create a valve management class to connect to the device and perform related searches at the beginning and status control during operation. Create a driver head display device class to realize whether the head display device is displayed on the desktop and whether it is displayed in reality; Get device component capabilities, including device display name and mode; Define the LogWriter class to write system logs and initialize the driver parameter logs; Define the enumeration type Error to determine various error logs when loading the driver, which is convenient for later troubleshooting.

[0011] Step 8 is as follows: Install the driver under the Linux system, execute the install.sh script file through the sh command to install it, and enable the use of VR devices in the Kylin V10 operating system.

[0012] The beneficial effects of the present invention are: (1) The VR training implementation method based on the Kylin system provided by the present invention can enable the HTC vive Pro2, a VR device that is not compatible, to be adapted for use on the domestic Kylin operating system V10.

[0013] (2) The present invention provides a method for implementing VR training based on the Kylin system. The Kylin system adopts multiple security protection mechanisms, including mandatory access control, data encryption, intrusion detection, etc., to ensure the high security of the system. These security mechanisms can effectively defend against potential network attacks and data leakage risks, ensuring the safety of sensitive devices such as HTC Vive Pro2.

[0014] (3) The VR training implementation method based on the Kylin system provided by the present invention makes the HTC Vive Pro2 device more powerful than most devices of the same price in the field of VR devices in terms of functions and effects. By adapting it to the domestic Kylin system, the cost of developing other VR devices can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 The present invention is a flow chart of generating a device file and calling an open function in the Linux kernel.

[0016] Figure 2 A schematic diagram of matching the driver to the Linux kernel architecture in the VR training implementation method based on the Galaxy Kylin system of the present invention; Figure 3 A flow chart of the Linux operating system kernel and driver running in kernel space and the application accessing kernel resources; Figure 4 It is a flowchart of the user's operation on the Linux operating system kernel; DETAILED DESCRIPTION The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0017] The present invention provides a method for implementing VR training based on the Galaxy Kylin system, which is specifically implemented in the following steps: Step 1: Build the Rust language development environment; Step 2, use the open function to open the / dev / led driver and operate the underlying driver; like Figure 1 As shown, step 2 is specifically as follows: S1, load the driver module, generate a device file and the corresponding inode structure; S2, the application layer calls the open function to open the device file. When the upper layer calls open to the kernel, a soft interrupt occurs and enters the kernel space from the user space. S3, open calls the sys_open function. The sys_open function finds the information described by the struct inode structure corresponding to the device file according to the address of the file, obtains the type of the operating device, character device or block device, and allocates a struct file structure; S3, according to the major device number and minor device number recorded in the struct inode structure, obtain the struct cdev structure in the character device driver; S4, the Linux kernel records the first address of the memory space where the struct cdev structure is located in the i_cdev member of the structinode structure, and records the function operation interface address recorded in the struct cdev structure in the f_ops member of the struct file structure; S5, execute xxx_open driver function.

[0018] Loading driver module is as follows: Compile the driver into a module and use the command to load the driver module after the Linux kernel is started; after the driver is compiled, the extension is .ko.

[0019] The commands include insmod and modprobe. modprobe analyzes the dependencies of the driver modules and loads all dependent modules into the Linux kernel.

[0020] Step 3, initialize VIVE HID related settings; Step 3 is as follows: Configure VR device mode, make relevant settings for opening the device for the first time, read the device serial number and other related information, configure Steam and save the settings, define the SteamConfig structure, and define related parameters.

[0021] Step 4: Configure the VR device mode and obtain device data; Step 5, rewrite the OpenVR related calling interface in the Linux system; Step 6, define the device display component; Step 6 is as follows: Create a valve management class to connect to the device and perform related searches at the beginning and status control during operation. Create a driver head display device class to realize whether the head display device is displayed on the desktop and whether it is displayed in reality; Get device component capabilities, including device display name and mode; Define the LogWriter class to write system logs and initialize the driver parameter logs; Define the enumeration type Error to determine various error logs when loading the driver, which is convenient for later troubleshooting.

[0022] Step 7: Use the docker build command to build a Docker image and output the driver program. Step 8: Install the driver in the Linux system and execute the install.sh script file through the sh command to install it, so as to enable the use of VR devices in the Kylin V10 operating system.

[0023] Among them, Figure 2 As shown in the figure, the Linux kernel, as the kernel of the operating system, takes over the lowest-level hardware drivers and provides interface implementation for the application layer, which is suitable for various hardware and software combined systems. It has five core parts: process management, memory management, file system, device driver and network module.

[0024] Linux drivers are divided into three basic categories: character device drivers, block device drivers, and network device drivers. Among them, character device drivers usually have to implement at least open, close, read, and write system calls; block device drivers mainly access devices by transmitting fixed-size data, generally 512 or 1k; the communication between the kernel and network device drivers is completely different from the communication between the kernel and character and block drivers. The kernel calls a set of socket functions related to data packet transmission instead of read and write. Such as common network card devices and Bluetooth devices. A device does not necessarily belong to only one type. For example, USB WIFI and SDIO WIFI belong to network device drivers, and because they have USB and SDIO, they also belong to character device drivers.

[0025] like Figure 3 As shown in the figure, the Linux operating system kernel and driver program run in kernel space, and the application program runs in user space. Application programs access kernel resources through system calls, exceptions (interrupts), and traps. All of these are system calls. Linux drivers are part of the kernel, so they run in kernel space.

[0026] like Figure 4 As shown in the figure, when you want to operate the kernel in user space, such as using the open function to open the / dev / led driver, because user space cannot directly operate the kernel, you must use the system call method to "fall into" the kernel space from user space to operate the underlying driver.

[0027] Example 1 This embodiment provides a method for implementing VR training based on the Kylin system, which is specifically implemented in the following steps: Step 1: Build the Rust language development environment; Step 2, use the open function to open the / dev / led driver and operate the underlying driver; Step 3, initialize VIVE HID related settings; Step 4: Configure the VR device mode and obtain device data; Step 5, rewrite the OpenVR related calling interface in the Linux system; Step 6, define the device display component; Step 7: Use the docker build command to build a Docker image and output the driver program. Step 8: Install the driver under the Linux system kernel to enable the use of VR devices in the Kylin V10 operating system.

[0028] Example 2 On the basis of Example 1, Figure 1 As shown, step 2 is specifically as follows: S1, load the driver module, generate a device file and the corresponding inode structure; S2, the application layer calls the open function to open the device file. When the upper layer calls open to the kernel, a soft interrupt occurs and enters the kernel space from the user space. S3, open calls the sys_open function. The sys_open function finds the information described by the struct inode structure corresponding to the device file according to the address of the file, obtains the type of the operating device, character device or block device, and allocates a struct file structure; S3, according to the major device number and minor device number recorded in the struct inode structure, obtain the struct cdev structure in the character device driver; S4, the Linux kernel records the first address of the memory space where the struct cdev structure is located in the i_cdev member of the structinode structure, and records the function operation interface address recorded in the struct cdev structure in the f_ops member of the struct file structure; S5, execute xxx_open driver function.

[0029] Example 3 Based on Example 2, the loading driver module is specifically as follows: Compile the driver into a module and use the command to load the driver module after the Linux kernel is started; after the driver is compiled, the extension is .ko.

[0030] The commands include insmod and modprobe. modprobe analyzes the dependencies of the driver modules and loads all dependent modules into the Linux kernel.

[0031] Example 4 Based on Example 3, step 3 is specifically as follows: Configure VR device mode, make relevant settings for opening the device for the first time, read information related to the device serial number, configure Steam and save the settings, define the SteamConfig structure, and define relevant parameters.

[0032] Example 5 Based on Example 4, step 3 is specifically as follows: Create a valve management class to connect to the device and perform related searches at the beginning and status control during operation. Create a driver head display device class to realize whether the head display device is displayed on the desktop and whether it is displayed in reality; Get device component capabilities, including device display name and mode; Define the LogWriter class to write system logs and initialize the driver parameter logs; Define the enumeration type Error to determine various error logs when loading the driver, which is convenient for later troubleshooting.

[0033] Example 6 Based on Example 5, the driver is installed in the Linux system, and the install.sh script file is executed through the sh command to install it, so as to realize the use of VR devices in the Kylin V10 operating system.

[0034] Example 7 This embodiment provides VR training software that can be deployed on a Linux system, and implements Unity3d to release a Linux system, specifically: In the installation interface of Unity Hub, click "Add Module" in the upper right corner of the corresponding version: (1) Package release File>Build Settings to open the packaging settings interface and make the following settings: (2) Run the program The operation of the program is different from that of the exe program in Windows. You cannot directly double-click to open the program. The specific steps are as follows: Modify permissions: In the folder where the program is located, right-click the option: Open in Terminal and enter the following: chmod 777. / LinuxTest.x86_64; After completion, press Enter to complete the modification. Also, in the folder where the program is located, right-click the option: Open in Terminal and enter the following content: / LinuxTest.x86_64 to run it.

[0035] The VR training implementation method based on the Kylin system provided by the present invention, since the domestically produced Kylin operating system V10 is developed based on the Linux operating system, when the virtual simulation application is released, the virtual simulation application should be released as a Linux version.

Claims

1. A VR training implementation method based on the Galaxy Kylin system, characterized in that: Please follow the steps below to implement: Step 1: Build the Rust language development environment; Step 2, use the open function to open the / dev / led driver and operate the underlying driver; Step 3, initialize VIVE HID related settings; Step 4: Configure the VR device mode and obtain device data; Step 5, rewrite the OpenVR related calling interface in the Linux system; Step 6, define the device display component; Step 7: Use the docker build command to build a Docker image and output the driver program. Step 8: Install the driver under the Linux system kernel to enable the use of VR devices in the Kylin V10 operating system.

2. The method for implementing VR training based on the Galaxy Kylin system according to claim 1 is characterized in that: The step 2 is specifically as follows: S1, load the driver module, generate a device file and the corresponding inode structure; S2, the application layer calls the open function to open the device file. When the upper layer calls open to the kernel, a soft interrupt occurs and enters the kernel space from the user space. S3, open calls the sys_open function. The sys_open function finds the information described by the struct inode structure corresponding to the device file according to the address of the file, obtains the type of the operating device, character device or block device, and allocates a struct file structure; S3, according to the major device number and minor device number recorded in the struct inode structure, obtain the struct cdev structure in the character device driver; S4, the Linux kernel records the first address of the memory space where the struct cdev structure is located in the i_cdev member of the struct inode structure, and records the function operation interface address recorded in the struct cdev structure in the f_ops member of the structfile structure; S5, execute xxx_open driver function.

3. The method for implementing VR training based on the Galaxy Kylin system according to claim 2 is characterized in that: The loading driver module is specifically: Compile the driver into a module and use the command to load the driver module after the Linux kernel is started; after the driver is compiled, the extension is .ko.

4. The method for implementing VR training based on the Galaxy Kylin system according to claim 3 is characterized in that: The commands include insmod and modprobe commands. modprobe analyzes the dependency relationship of the driver module and loads all dependent modules into the Linux kernel.

5. The method for implementing VR training based on the Galaxy Kylin system according to claim 1 is characterized in that: The step 3 is specifically as follows: configuring the VR device mode, performing relevant settings for opening the device for the first time, reading information related to the device serial number, configuring Steam and saving the settings, defining the SteamConfig structure, and defining relevant parameters.

6. The method for implementing VR training based on the Galaxy Kylin system according to claim 1 is characterized in that: The acquisition of device data in step 4 specifically includes: acquiring relevant device information through an API.

7. The method for implementing VR training based on the Galaxy Kylin system according to claim 1 is characterized in that: The step 6 is specifically as follows: Create a valve management class to connect to the device and perform related searches at the beginning and status control during operation. Create a driver head display device class to realize whether the head display device is displayed on the desktop and whether it is displayed in reality; Get device component capabilities, including device display name and mode; Define the LogWriter class to write system logs and initialize the driver parameter logs; Define the enumeration type Error to determine various error logs when loading the driver, which is convenient for later troubleshooting.

8. The method for implementing VR training based on the Galaxy Kylin system according to claim 1 is characterized in that: The step 8 is specifically as follows: installing the driver under the Linux system, executing the install.sh script file through the sh command to install it, and realizing the use of the VR device in the Kylin V10 operating system.