Instrument HMI system realized based on QNX Screen and Opengl ES
By using the combination of QNX Screen and Opengl ES in the automotive instrument HMI system, flexible sequence frame playback and lightweight interface encapsulation are achieved, which solves the problems of high development cost and poor flexibility of traditional HMI systems, and provides a low-cost, easy-to-use Development and high-performance instrumentation HMI systems.
Patent Information
- Application Number
- CN202410761654.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-20
AI Technical Summary
The development cost of traditional automotive instrument HMI systems is high and relies on specific technologies and platforms, which limits the flexibility and scalability of the project, making it difficult to provide low-cost and beautiful automotive instruments in a highly competitive market.
Adopt a new instrument HMI system based on QNX Screen and Opengl ES, realize flexible sequence frame playback function through QNX Screen, and use Opengl ES to provide lightweight software interface encapsulation, hide the underlying details, and provide an easy-to-use, concise and intuitive interface , combined with QNX Pixmap, QNX Img library and C++ lodepng third-party library to achieve an efficient and multi-functional resource input and management solution.
Implemented a low-cost, easy-to-develop and maintain instrument HMI system that supports hardware acceleration, provides playback duration controllability, display size controllability and resource diversity, reduces dependence on external payment engines, and improves system flexibility. and performance.
Smart Images

Figure CN118672576A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automobile full liquid crystal instruments, and in particular relates to a new instrument HMI system based on QNX Screen and OpenglES. Background Art
[0002] With the rapid development of display technology and electronic technology, consumers have higher and higher requirements for the aesthetics and technological sense of car interiors. Traditional mechanical instrument panels have been basically replaced by LCD screens. The application of intelligent technology has also enabled instrument HMI to have more functions. How to ensure quality and performance while reducing costs is an important challenge facing the development of instrument HMI. Traditional HMI design is developed using KANZI and QT engines. These paid engines usually require high licensing fees, which not only increases the cost of HMI development, but also relies on specific technologies and platforms, limiting the flexibility and scalability of the project. In the highly competitive automotive market, low-cost design has become a competitive advantage for automakers. By providing lower-priced automotive instruments that do not affect the appearance, manufacturers can gain more market share. Summary of the invention
[0003] To achieve the above purpose, the present invention proposes an instrument HMI system solution based on QNX Screen and Opengl ES. Without the need to purchase a paid engine, QNX Screen is used to implement a flexible sequence frame playback function; Opengl ES is used to implement a complete interface encapsulation, providing an easy-to-use, concise, intuitive, and maintainable interface that hides the underlying details of OpenGL.
[0004] The technical solution of the present invention is as follows: an instrument HMI system based on QNX Screen and Opengl ES, the system includes a Communication layer responsible for receiving external data, a DataFilter layer filtering, storing and forwarding the received data, a Base layer and an Application layer as the middle layer of the software system responsible for encapsulating native interfaces and other functions, the Communication layer is responsible for external data communication functions, and encapsulates QNX's DBUS communication mode and Socket communication mode, DBUS is mainly responsible for communication with MCU, Socket is responsible for analog communication with central control or PC, the Datafilter layer is responsible for filtering, forwarding and storing the data received from the outside, and the Base abstract layer is responsible for encapsulating the underlying interface and referencing the third-party library.
[0005] As an improvement of the present invention, the Base layer, as the middle layer of the software system, implements functional node encapsulation based on the Opengl ES interface. The EsNode node has the ability to perform basic drawing on the window, including: creating nodes with specified positions and sizes, coordinate conversion, vertex attributes and uniform variable configuration, and shader rendering. Other nodes inherit from EsNode to implement their own unique functions.
[0006] As an improvement of the present invention, the Base abstract layer combines QNX Screen and EGL to implement instrument window encapsulation, and utilizes the characteristics of structure composite data types to implement the encapsulation of various window parameters.
[0007] As an improvement of the present invention, the Base abstract layer introduces a third-party library including a signal and slot SignalSlot interface for communication, realizes asynchronous communication of external data, synchronous communication of internal data, a Timer interface for a timer, a C++ mutex interface and a QNX log interface.
[0008] As an improvement of the present invention, the Application layer performs structural hierarchical planning and layout management of the instrument UI module in the form of a control tree, with the structural hierarchy of the UI node on the left and the layout on the corresponding window on the right. The lower the structural hierarchy, the more forward the layout display in the window.
[0009] As an improvement of the present invention, the Application layer is also responsible for the process control of the entire instrument process. The process is mainly divided into four modules: initialization, resource callback, rendering and data update. Initialization mainly includes project configuration, data communication initialization and initialization of each functional module, resource preloading, to ensure that the initialization of the entire project is completed before the first frame is displayed. The resource callback module is used to cyclically detect whether the current resource has been preloaded. The rendering module is used to forward traverse all node rendering operations on the tree structure. The update module realizes the timer and other functions that need to be updated for each frame of external data.
[0010] As an improvement of the present invention, the system also includes two classes: Resource Manager Class and ImageClass. Resource Manager Class is responsible for inputting different types of image resources and loading image resources in different ways, and Image Class is responsible for decompressing and decoding images and storing images in different forms.
[0011] As an improvement of the present invention, the Resource Manager Class class includes a LoadInSequence module, which is responsible for processing sequence frame data, can accept different image types for decompression or decoding, and then cache the data on QNX Pixmap. LoadToPixmap is responsible for static image display, and decodes the image through the Img library that comes with QNX and caches it on QNX Pixmap. When it needs to be displayed later, it is directly copied to the screen display cache. LoadImage and preloadImage both accept and process PNG images and decode them into RGBA data.
[0012] As an improvement of the present invention, LoadImage directly loads the image after receiving the image path, while PreloadImage will start another thread for non-blocking loading. Both will call loadImage and use the lodepng::load_file function to decode and store the image. Later, in the Opengl rendering process, the image cache is loaded into the GPU through the getTexture interface.
[0013] Compared with the prior art, the beneficial effects of the present invention are: 1) Implement a flexible sequence frame playback solution based on QNX Screen, support hardware acceleration, controllable playback duration, controllable display size, and accept diverse input resources; 2) Implement a set of lightweight software interface encapsulation based on Opengl ES, which has low resource consumption, does not rely on external payment engines, is low-cost, and is easy to develop and maintain; 3) Combine QNX Pixmap, QNX Img library and C++ lodepng third-party library to implement an efficient and multi-functional resource input and management solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a block diagram of the instrument HMI system proposed by the present invention; Figure 2 The instrument work flow chart proposed by the present invention; Figure 3 This is a flow chart of the sequence frame playback based on QNX Screen proposed by the present invention; Figure 4 This is a flowchart of image resource input and management proposed by the present invention; Figure 5 This is the instrument HMI window structure hierarchy and layout management diagram proposed by the present invention. DETAILED DESCRIPTION
[0015] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0016] Example: Implement a flexible sequence frame playback solution based on QNX Screen. This solution is mature, stable and efficient. QNX Screen is a set of APIs for graphics rendering and user interface development in the QNX operating system. The API can be directly called to implement window buffering and other rendering operations. Sequence frames are composed of static images one by one, and have independent window caches in this solution. Based on Opengl ES, a set of lightweight software interface encapsulation is implemented to realize instrument element drawing, with low resource consumption, no reliance on external payment engines, low cost, and easy development and maintenance. The entire system framework is as follows Figure 1 As shown: From bottom to top, it is divided into Communication layer, DataFilter layer, Base layer and Application layer. The Communication layer is responsible for receiving external data, and encapsulates the DBUS communication module and socket communication module. The DataFilter layer filters, stores and forwards the received data. The Base layer, as the middle layer of the software system, is responsible for the encapsulation of native interfaces and other functions. Its main functions are as follows: 1) Based on the Opengl ES interface, the function node encapsulation is implemented. The EsNode node has the ability to perform basic drawing on the window, including: creating nodes with specified positions and sizes, coordinate conversion, configuring vertex attributes and uniform variables, and shader rendering. Other nodes inherit from EsNode to implement their own unique functions. For example, the TextNode node is combined with the freetype library to implement text drawing, which is usually applied to the total mileage ODO and the endurance DTE of the instrument. The ImageNode node adds texture applications and displays specified images, which can be applied to other TT lights such as instrument background, fuel temperature, etc. The MaterialNode node provides custom shader programming to achieve more complex 2D rendering, which can be applied to instrument headers and ADAS to achieve cooler effects. In addition, other functions are encapsulated, such as node layout and data damping. 2) Combine QNX Screen and EGL to realize instrument window encapsulation, and use the characteristics of structure composite data type to realize the encapsulation of various window parameters, so that the creation and parameter configuration of instrument window are clear; 3) Introduce third-party libraries including SignalSlot interface for communication, realize asynchronous communication of external data and synchronous communication of internal data, Timer interface for timer, C++ mutex interface and QNX log interface.
[0017] The Application layer plans and manages the structure and layout of UI modules such as instrument Animation, Gauge, and RTT in the form of a control tree. Figure 5 As shown in the figure, the left side is the structure layer of the UI node, and the right side is the layout on the corresponding window. The lower the structure layer is, the more forward the layout display in the window is. Application is also responsible for the process control of the entire instrument process. The process is mainly divided into four modules: initialization, resource callback, rendering, and data update. Figure 2 As shown in the figure, initialization mainly includes project configuration, data communication initialization, initialization of each functional module, and resource preloading to ensure that the entire project is initialized before the first frame is displayed. The resource callback module is used to loop and detect whether the current resource has been preloaded. The rendering module is used to forward traverse all the node rendering operations on the tree structure, and the update module implements timers and other functions that need to be updated in each frame, such as external data.
[0018] Combine QNX Pixmap, QNX Img library and C++ lodepng third-party library to realize an efficient and multifunctional resource input and management solution. The solution mainly consists of two classes: Resource Manager Class and Image Class. Resource Manager Class is responsible for inputting different types of image resources and loading image resources in different ways, while ImageClass is responsible for image decompression, decoding and different forms of image storage. Figure 4 As shown in the figure, this solution not only accepts image data in different compression formats, such as PNG / BMP / JPG, but also accepts raw YUV image data. LoadInSequence is responsible for processing sequence frame data, and can accept different image types for decompression or decoding, and then cache the data on QNX Pixmap. The specific process is as follows Figure 3As shown. loadToPixmap is responsible for static image display. It decodes the image cache to QNX Pixmap through QNX's own Img library. When it needs to be displayed later, it is directly copied to the screen display cache. LoadImage and preloadImage both accept and process PNG images and decode them into RGBA data, but their loading methods are different. LoadImage directly loads after receiving the image path, while PreloadImage will start another thread for non-blocking loading. They will call loadImage and use lodepng::load_file function to decode and store the image. Later, in the Opengl rendering process, the image cache is loaded to the GPU through the getTexture interface. The sequence frame developed based on QNX Screen directly operates the image data and window cache, which weakens the complexity of the programming model, reduces many complex operations in the engine, and improves the rendering frame rate. The sequence frame playback duration is controllable, the display size is controllable, and the input resource diversity is accepted. The flexibility, accuracy and freedom of the use of sequence frames are improved. The same screen cache uses different QNX Pixmaps to implement different types of image processing. Pixmap supports hardware acceleration and can use hardware resources such as GPU to accelerate the rendering process and improve rendering performance, thereby providing a better user experience. OpenGL ES replaces other paid engines to achieve complete interface encapsulation, which not only enables low-cost and convenient development, but also has low resource consumption and can be well applied on devices with limited resources. A set of efficient and multi-functional resource input and management processes implemented by combining QNX Pixmap, QNX img library and C++ lodepng third-party library. Its process handles multiple types of resources, asynchronous loading and resource caching, realizes unified resource management and flexible application in different scenarios.
[0019] like Figure 1As shown: represents the block diagram of the instrument HMI system. From bottom to top, it is divided into 4 layers, namely Communication layer, Datafilter layer, Base abstract layer, and Application layer. The Communication layer is responsible for external data communication functions and encapsulates QNX's DBUS communication mode and Socket communication mode. DBUS is mainly responsible for communication with MCU, and Socket is responsible for analog communication with the central control or PC. The Datafilter layer is responsible for filtering, forwarding and storing data received from the outside. The Base abstract layer is responsible for the encapsulation of the underlying interface and the reference of the third-party library. Sequence is responsible for the interface encapsulation of the reception, storage, and start-stop control of sequence frame data; Screen Window is responsible for the interface encapsulation of Screen window creation, and EGLWindow is responsible for the encapsulation of EGL window related functions; each node in Opengl ES Node is an encapsulation of Opengl ESAPI. The EsNode class implements shader encapsulation, texture application, and coordinate conversion function encapsulation. Other nodes implement their own unique functions, such as TextNode text display node, ColorNode color display node, ImageNode image display node, and MaterialNode custom shader to implement more complex display nodes, layoutNode layout nodes for layout, and ButtonNode nodes responsible for button functions. Com contains references to third-party libraries, including SignalSlot signals and slots responsible for internal project communication, Timer timer, Mutex data mutex lock, and QNX log. Application is responsible for the development of various functional modules of the instrument.
[0020] like Figure 2As shown: Instrument workflow. The instrument HMI system has a process including the main rendering thread and the data processing thread. The main thread is responsible for the rendering of the instrument interface, the sub-thread is responsible for data reception and processing, and the communication between threads is realized through SignalSlot. The main thread first creates the application object through createApplication and executes it. In onConfigure, it is responsible for project configuration, such as the definition of environment variables, resource addresses, etc. OnProjectLoaded is responsible for the initialization of each module of the project and the preloading call of resources. Next, the frame loop process is carried out. First, ResourceCallBack is responsible for the callback detection of resource preloading. Whether the resource preloading is successful will be detected before each frame. Render is responsible for the rendering operation of each frame. By calling each window (ScreenWindow1 and Screen Window2) in the window container in turn, and calling each Opengl ES node in each called window in turn, each node that needs to be drawn (such as the header node GaugeNode, the speed node SpeedNode, the indicator node RTTNode, and the animation playback node Animation) is traversed forward, and all information is updated to the screen back buffer until the buffer exchange is called to specify that the content of the back buffer is exchanged to the front buffer for display. OnUpdate is used for data update.
[0021] Figure 3It is a sequence frame playback process based on QNX Screen. The left column represents the compressed YUV data sequence frame display process. Note that YUV data is selected here. In the case of lossless conversion, the data size of YUV and RGB data formats is the same. Considering human perception, the amount of data can be reduced by reducing the bandwidth of chrominance. The data volume of YUV420 data format is only half of that of RGB888 data format, which can greatly reduce the amount of image data. The continuity of the storage method of YUV format is more suitable for data compression than RGB format, so it is better than RGB in terms of compression rate and decompression efficiency. Although obtaining the compressed RGB / YUV data in advance simplifies the process of image decoding in the program, it increases the size of the data. Therefore, the compression algorithm here is crucial. Under the trade-off between compression rate and decompression rate, the Snappy compression and decompression library is used here. Use the fread function of the C library to read the file into the buffer, and then decompress and copy the data to the QNX Pixmap through mencpy. Pixmap supports hardware acceleration, and data can be transferred to the Screen buffer through hardware acceleration to improve rendering performance. The right column is the process of directly decoding PNG in the program. The file reading speed is limited by the hardware bandwidth and file size. For some low-end devices, and static images with low content complexity and small data volume, it is better to use the decoding solution directly. In the figure, Pixmap buffer1 and Pixmap buffer2 represent the cache area of the final decoded image data, and Screen buffer1 and Screen buffer2 represent the window video memory area. Other processes also include the selection of sequence frame indexes, and the start and stop control of sequence frames according to current parameters or signals.
[0022] like Figure 3As shown, the sequential frame scheme has two image resource input channels, one for processing YUV image data compressed by the Snappy algorithm, and the other for processing PNG / BMP / JPG image data. Their processes will first register the image data to the corresponding container and set the image index. The difference starts from reading the image data. The YUV image compression data is read through the C library fread function, decompressed using the snappy algorithm, copied to the QNX Pixmap, and finally hard-copied to the screen buffer. The other channel directly reads the PNG / BMP / JPG image file through the img_load_file function of the QNX built-in Img library, decodes it into RGB image data, and copies the data to another QNX Pixmap. Note that the QNX Pixmap here stores different types of image data, which can be placed in the same screen buffer because Pixmap can achieve flexible format conversion. Screen double buffering is also implemented for the same window to improve rendering performance. After each frame is rendered, the start / stop flag signal of the current sequence frame, the loop configuration word of the sequence frame, and the sequence frame playback time configuration word are judged to determine whether to execute the next frame and the sequence frame index of the next frame. The calculation method for the fixed sequence frame playback duration is implemented under the assumption that the sequence frame rate is 30Fps. Assuming that the playback duration is T, the timing starts from the start of the sequence frame playback, and the playback time interval to the current sequence frame is t, the sequence frame index Index = (30*t) / T, and the key sequence frame interface functions refer to Table 1.
[0023] Table 1 shows the eight key function interfaces implemented by the sequence frame.
[0024] like Figure 4As shown: This is the resource input and management process. Resource Manager Class is an image resource management class, responsible for the input and loading of image resources; Image Class is an image processing class, responsible for the decompression, decoding and storage of different types of images, where map represents the container for storing image resources. The loadInSequence module is used to process sequence frames. According to different types of sequence frames, the Snappy_Lode_Pixmap module function is called to decode or decompress the image, store it in QNX Pixmap, and put the data into the screen buffer through hardware acceleration. Note that the LodePNG external link library is used for decoding here, and the Snappy compression and decompression library is used for decompression. loadToPixmap processes the function of converting static images to QNX Pixmap, and calls the QNX img library through the QnxImg_Pixmap module for image processing and puts it into the screen buffer. The image resources loaded by loadImg and preloadImage are used for GPU rendering. loadImg processes a single texture, and preloadImage preloads batches of textures. A thread is started each time it is loaded, and the callback function is used to obtain whether the resource has been loaded.
[0025] like Figure 5 As shown in the figure, the structure hierarchy and layout management diagram of the instrument HMI window. The left side is the structural hierarchy of the UI node, and the right side is the layout of the corresponding window under the three-dimensional coordinates. The window is at the bottom layer, and the root node Root Node (as the main node), the background node Background Node (responsible for background-related functions), the header node Gauge Node (responsible for vehicle speed and speed-related functions), and the indicator light node RTT Node (responsible for indicator light display-related functions) are arranged outward in sequence. The lower the structural hierarchy is, the more forward the layout display in the window is.
[0026] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. 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 all fall within the protection scope of the claims of the present invention.
Claims
1. An instrument HMI system based on QNX Screen and Opengl ES, characterized in that: The system includes a Communication layer responsible for receiving external data, a DataFilter layer that filters, stores and forwards the received data, a Base layer that is the middle layer of the software system and is responsible for encapsulating native interfaces and other functions, and an Application layer. The Communication layer is responsible for external data communication functions and encapsulates QNX's DBUS communication mode and Socket communication mode. DBUS is mainly responsible for communication with the MCU, and Socket is responsible for analog communication with the central control or PC. The Datafilter layer is responsible for filtering, forwarding and storing data received from the outside. The Base abstract layer is responsible for encapsulating the underlying interface and referencing third-party libraries.
2. According to claim 1, the instrument HMI system based on QNX Screen and Opengl ES is characterized in that: As the middle layer of the software system, the Base layer implements function node encapsulation based on the Opengl ES interface. The EsNode node has the ability to perform basic drawing on the window, including: creating nodes with specified positions and sizes, coordinate conversion, vertex attributes and uniform variable configuration, and shader rendering. Other nodes inherit from EsNode to implement their own unique functions.
3. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The Base abstract layer combines QNX Screen and EGL to implement instrument window encapsulation, and uses the characteristics of structure composite data types to implement the encapsulation of various window parameters.
4. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The Base abstract layer introduces third-party libraries including the SignalSlot interface for communication, which realizes asynchronous communication of external data, synchronous communication of internal data, the Timer interface for timers, the C++ mutex interface and the QNX log interface.
5. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The Application layer plans and manages the structure of the instrument UI module in the form of a control tree. The left side is the structural hierarchy of the UI node, and the right side is the layout on the corresponding window. The lower the structural hierarchy, the more forward the layout display in the window.
6. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The Application layer is also responsible for the process control of the entire instrument process. The process is mainly divided into four modules: initialization, resource callback, rendering, and data update. Initialization mainly includes project configuration, data communication initialization, initialization of various functional modules, and resource preloading to ensure that the initialization of the entire project is completed before the first frame is displayed. The resource callback module is used to cyclically detect whether the current resource has been preloaded. The rendering module is used to forward traverse all node rendering operations on the tree structure. The update module implements the timer and other functions that need to be updated for each frame of external data.
7. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The system also includes two classes: Resource Manager Class and Image Class. ResourceManager Class is responsible for inputting different types of image resources and loading image resources in different ways, while Image Class is responsible for decompressing and decoding images and storing images in different forms.
8. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: The Resource Manager Class class includes LoadInSequence, which is responsible for processing sequence frame data. It can accept different image types for decompression or decoding, and then cache the data on QNX Pixmap. LoadToPixmap is responsible for static image display. It decodes the image through QNX's own Img library and caches it on QNX Pixmap. When it needs to be displayed later, it is directly copied to the screen display cache. LoadImage and preloadImage both accept and process PNG images and decode them into RGBA data.
9. The instrument HMI system based on QNX Screen and Opengl ES according to claim 1, characterized in that: LoadImage directly loads the image after receiving the image path, while PreloadImage will start another thread for non-blocking loading. Both will call loadImage and use the lodepng::load_file function to decode and store the image. Later in the Opengl rendering process, the image cache is loaded into the GPU through the getTexture interface.
